Panda3D
 All Classes Functions Variables Enumerations
dcbase.h
1 // Filename: dcbase.h
2 // Created by: drose (05Oct00)
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 #ifndef DCBASE_H
16 #define DCBASE_H
17 
18 // This file defines a few headers and stuff necessary for compilation
19 // of the files in this directory. This is different from most of the
20 // other source directories within Panda, since the dcparser is
21 // designed to be compilable outside of Panda (for use by the server
22 // code). Therefore, it must not depend on including any of the Panda
23 // header files, and we have to duplicate some setup stuff here.
24 
25 #ifdef WITHIN_PANDA
26 // On the other hand, if WITHIN_PANDA is defined, we *are* safely
27 // within the Panda environment.
28 
29 #include "directbase.h"
30 #include "pnotify.h"
31 #include "numeric_types.h"
32 #include "filename.h"
33 #include "pvector.h"
34 #include "pmap.h"
35 #include "pset.h"
36 
37 #else // WITHIN_PANDA
38 
39 #ifdef WIN32
40 /* C4786: 255 char debug symbols */
41 #pragma warning (disable : 4786)
42 /* C4503: decorated name length exceeded */
43 #pragma warning (disable : 4503)
44 #endif /* WIN32_VC */
45 
46 #include <iostream>
47 #include <fstream>
48 #include <iomanip>
49 #include <sstream>
50 
51 #include <string>
52 #include <assert.h>
53 
54 // These header files are needed to compile dcLexer.cxx, the output
55 // from flex. flex doesn't create a perfectly windows-friendly source
56 // file right out of the box.
57 #ifdef WIN32
58 #include <io.h>
59 #include <malloc.h>
60 #else
61 #include <unistd.h>
62 #endif
63 
64 using namespace std;
65 
66 #define INLINE inline
67 #define TYPENAME typename
68 
69 // These symbols are used within the Panda environment for exporting
70 // classes and functions to the scripting language. They're largely
71 // meaningless if we're not compiling within Panda.
72 #define PUBLISHED public
73 #define BEGIN_PUBLISH
74 #define END_PUBLISH
75 #define BLOCKING
76 
77 // Panda defines some assert-type macros. We map those to the
78 // standard assert macro outside of Panda.
79 #define nassertr(condition, return_value) assert(condition)
80 #define nassertr_always(condition, return_value) assert(condition)
81 #define nassertv(condition) assert(condition)
82 #define nassertv_always(condition) assert(condition)
83 
84 // Panda defines these export symbols for building DLL's. Outside of
85 // Panda, we assume we're not putting this code in a DLL, so we define
86 // them to nothing.
87 #define EXPCL_DIRECT
88 #define EXPTP_DIRECT
89 
90 // Panda defines a special Filename class. We'll use an ordinary
91 // string instead.
92 typedef string Filename;
93 
94 // Panda defines WORDS_BIGENDIAN on a bigendian machine; otherwise,
95 // the machine is assumed to be littleendian. Outside of Panda,
96 // you're responsible for defining this yourself if necessary.
97 //#define WORDS_BIGENDIAN
98 
99 #include <vector>
100 #include <map>
101 #include <set>
102 #define pvector vector
103 #define pmap map
104 #define pset set
105 
106 #ifdef WIN32
107 typedef __int64 PN_int64;
108 typedef unsigned __int64 PN_uint64;
109 #else
110 typedef long long PN_int64;
111 typedef unsigned long long PN_uint64;
112 #endif
113 
114 typedef unsigned char PN_uint8;
115 typedef unsigned short PN_uint16;
116 typedef unsigned int PN_uint32;
117 
118 typedef ifstream pifstream;
119 typedef ofstream pofstream;
120 typedef fstream pfstream;
121 
122 #endif // WITHIN_PANDA
123 
124 //typedef unsigned long CHANNEL_TYPE;
125 typedef PN_uint64 CHANNEL_TYPE;
126 typedef PN_uint32 DOID_TYPE;
127 typedef PN_uint32 ZONEID_TYPE;
128 
129 #endif // DCBASE_H
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:44