Panda3D
 All Classes Functions Variables Enumerations
pre_maya_include.h
00001 // Filename: pre_maya_include.h
00002 // Created by:  drose (11Apr02)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 // This header file defines a few things that are necessary to define
00016 // before including any Maya headers, just to work around some of
00017 // Maya's assumptions about the compiler.  It must not try to protect
00018 // itself from multiple inclusion with #ifdef .. #endif, since it must
00019 // be used each time it is included.
00020 
00021 // Maya 2008 will declare some VS2005-specific hacks unless we define
00022 // this.
00023 #if defined(_MSC_VER) && _MSC_VER < 1400
00024 #define MLIBRARY_DONTUSE_MFC_MANIFEST
00025 #endif
00026 
00027 // Maya will try to typedef bool unless this symbol is defined.
00028 #ifndef _BOOL
00029 #define _BOOL 1
00030 #endif
00031 
00032 #ifdef MAYA_PRE_5_0
00033 // Old versions of Maya, before version 5.0, used <iosteam.h>
00034 // etc. instead of the new <iostream> headers.  This requires some
00035 // workarounds to make this work compatibly with Panda, which uses the
00036 // new headers.
00037 
00038 // In windows, the antiquated headers define completely unrelated (and
00039 // incompatible) classes from those declared in the new headers.  On
00040 // the other hand, in gcc the antiquated headers seem to be references
00041 // to the new template classes, so under gcc we also have to declare
00042 // typedefs to make this work.
00043 #ifdef __GNUC__
00044 #ifndef PRE_MAYA_INCLUDE_H
00045 #define PRE_MAYA_INCLUDE_H
00046 #include <iostream.h>
00047 typedef ostream maya_ostream;
00048 typedef istream maya_istream;
00049 #endif
00050 #endif  // __GNUC__
00051 
00052 #define ostream maya_ostream
00053 #define istream maya_istream
00054 
00055 #else  // MAYA_PRE_5_0
00056 
00057 // In Maya 5.0, the headers seem to provide the manifest
00058 // REQUIRE_IOSTREAM, which forces it to use the new <iostream> headers
00059 // instead of the old <iostream.h> headers.  It also says this is for
00060 // Linux only, but it seems to work just fine on Windows, obviating
00061 // the need for sneaky #defines in this and in post_maya_include.h.
00062 #ifdef PHAVE_IOSTREAM
00063 #define REQUIRE_IOSTREAM
00064 #endif  // PHAVE_IOSTREAM
00065 
00066 #ifdef __MACH__
00067 #undef _BOOL
00068 #include "maya/OpenMayaMac.h"
00069 #endif
00070 
00071 #endif  // MAYA_PRE_5_0
00072 
 All Classes Functions Variables Enumerations