00001 // Filename: dcbase.h 00002 // Created by: drose (05Oct00) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #ifndef DCBASE_H 00020 #define DCBASE_H 00021 00022 // This file defines a few headers and stuff necessary for compilation 00023 // of the files in this directory. This is different from most of the 00024 // other source directories within Panda, since the dcparser is 00025 // designed to be compilable outside of Panda (for use by the server 00026 // code). Therefore, it must not depend on including any of the Panda 00027 // header files, and we have to duplicate some setup stuff here. 00028 00029 #ifdef WITHIN_PANDA 00030 // On the other hand, if WITHIN_PANDA is defined, we *are* safely 00031 // within the Panda environment. 00032 00033 #include <directbase.h> 00034 #include <notify.h> 00035 #include <filename.h> 00036 #include <numeric_types.h> 00037 #include "pvector.h" 00038 #include "pmap.h" 00039 00040 #else // WITHIN_PANDA 00041 00042 #ifdef WIN32 00043 /* C4786: 255 char debug symbols */ 00044 #pragma warning (disable : 4786) 00045 /* C4503: decorated name length exceeded */ 00046 #pragma warning (disable : 4503) 00047 #endif /* WIN32_VC */ 00048 00049 #if defined(WIN32) 00050 #include <iostream> 00051 #include <fstream> 00052 #include <iomanip> 00053 #else 00054 #include <iostream.h> 00055 #include <fstream.h> 00056 #include <iomanip.h> 00057 #endif 00058 00059 #include <string> 00060 #include <assert.h> 00061 00062 // These header files are needed to compile dcLexer.cxx, the output 00063 // from flex. flex doesn't create a perfectly windows-friendly source 00064 // file right out of the box. 00065 #ifdef WIN32 00066 #include <io.h> 00067 #include <malloc.h> 00068 #else 00069 #include <unistd.h> 00070 #endif 00071 00072 using namespace std; 00073 00074 // These symbols are used within the Panda environment for exporting 00075 // classes and functions to the scripting language. They're largely 00076 // meaningless if we're not compiling within Panda. 00077 #define PUBLISHED public 00078 #define BEGIN_PUBLISH 00079 #define END_PUBLISH 00080 00081 // Panda defines some assert-type macros. We map those to the 00082 // standard assert macro outside of Panda. 00083 #define nassertr(condition, return_value) assert(condition) 00084 #define nassertv(condition) assert(condition) 00085 00086 // Panda defines these export symbols for building DLL's. Outside of 00087 // Panda, we assume we're not putting this code in a DLL, so we define 00088 // them to nothing. 00089 #define EXPCL_DIRECT 00090 #define EXPTP_DIRECT 00091 00092 // Panda defines a special Filename class. We'll use an ordinary 00093 // string instead. 00094 typedef string Filename; 00095 00096 // Panda defines WORDS_BIGENDIAN on a bigendian machine; otherwise, 00097 // the machine is assumed to be littleendian. Outside of Panda, 00098 // you're responsible for defining this yourself if necessary. 00099 //#define WORDS_BIGENDIAN 00100 00101 #include <vector> 00102 #include <map> 00103 #define pvector vector 00104 #define pmap map 00105 00106 #endif // WITHIN_PANDA 00107 00108 #endif // DCBASE_H