Panda3D
 All Classes Functions Variables Enumerations
pre_maya_include.h
1 // Filename: pre_maya_include.h
2 // Created by: drose (11Apr02)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 // This header file defines a few things that are necessary to define
16 // before including any Maya headers, just to work around some of
17 // Maya's assumptions about the compiler. It must not try to protect
18 // itself from multiple inclusion with #ifdef .. #endif, since it must
19 // be used each time it is included.
20 
21 // Maya 2008 will declare some VS2005-specific hacks unless we define
22 // this.
23 #if defined(_MSC_VER) && _MSC_VER < 1400
24 #define MLIBRARY_DONTUSE_MFC_MANIFEST
25 #endif
26 
27 // Maya will try to typedef bool unless this symbol is defined.
28 #ifndef _BOOL
29 #define _BOOL 1
30 #endif
31 
32 #ifdef MAYA_PRE_5_0
33 // Old versions of Maya, before version 5.0, used <iosteam.h>
34 // etc. instead of the new <iostream> headers. This requires some
35 // workarounds to make this work compatibly with Panda, which uses the
36 // new headers.
37 
38 // In windows, the antiquated headers define completely unrelated (and
39 // incompatible) classes from those declared in the new headers. On
40 // the other hand, in gcc the antiquated headers seem to be references
41 // to the new template classes, so under gcc we also have to declare
42 // typedefs to make this work.
43 #ifdef __GNUC__
44 #ifndef PRE_MAYA_INCLUDE_H
45 #define PRE_MAYA_INCLUDE_H
46 #include <iostream.h>
47 typedef ostream maya_ostream;
48 typedef istream maya_istream;
49 #endif
50 #endif // __GNUC__
51 
52 #define ostream maya_ostream
53 #define istream maya_istream
54 
55 #else // MAYA_PRE_5_0
56 
57 // In Maya 5.0, the headers seem to provide the manifest
58 // REQUIRE_IOSTREAM, which forces it to use the new <iostream> headers
59 // instead of the old <iostream.h> headers. It also says this is for
60 // Linux only, but it seems to work just fine on Windows, obviating
61 // the need for sneaky #defines in this and in post_maya_include.h.
62 #ifdef PHAVE_IOSTREAM
63 #define REQUIRE_IOSTREAM
64 #endif // PHAVE_IOSTREAM
65 
66 #ifdef __MACH__
67 #undef _BOOL
68 #include "maya/OpenMayaMac.h"
69 #endif
70 
71 #endif // MAYA_PRE_5_0
72