Panda3D
dcbase.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file dcbase.h
10  * @author drose
11  * @date 2000-10-05
12  */
13 
14 #ifndef DCBASE_H
15 #define DCBASE_H
16 
17 // This file defines a few headers and stuff necessary for compilation of the
18 // files in this directory. This is different from most of the other source
19 // directories within Panda, since the dcparser is designed to be compilable
20 // outside of Panda (for use by the server code). Therefore, it must not
21 // depend on including any of the Panda header files, and we have to duplicate
22 // some setup stuff here.
23 
24 #ifdef WITHIN_PANDA
25 // On the other hand, if WITHIN_PANDA is defined, we *are* safely within the
26 // Panda environment.
27 
28 #include "directbase.h"
29 #include "pnotify.h"
30 #include "numeric_types.h"
31 #include "filename.h"
32 #include "pvector.h"
33 #include "pmap.h"
34 #include "pset.h"
35 
36 #else // WITHIN_PANDA
37 
38 #ifdef WIN32
39 /* C4786: 255 char debug symbols */
40 #pragma warning (disable : 4786)
41 /* C4503: decorated name length exceeded */
42 #pragma warning (disable : 4503)
43 #endif /* WIN32_VC */
44 
45 #include <iostream>
46 #include <fstream>
47 #include <iomanip>
48 #include <sstream>
49 
50 #include <string>
51 #include <assert.h>
52 
53 // These header files are needed to compile dcLexer.cxx, the output from flex.
54 // flex doesn't create a perfectly windows-friendly source file right out of
55 // the box.
56 #ifdef WIN32
57 #include <io.h>
58 #include <malloc.h>
59 #else
60 #include <unistd.h>
61 #endif
62 
63 #define INLINE inline
64 
65 // These symbols are used within the Panda environment for exporting classes
66 // and functions to the scripting language. They're largely meaningless if
67 // we're not compiling within Panda.
68 #define PUBLISHED public
69 #define BEGIN_PUBLISH
70 #define END_PUBLISH
71 #define BLOCKING
72 
73 // These control the declspec(dllexport/dllimport) on Windows. When compiling
74 // outside of Panda, we assume we aren't part of a DLL.
75 #define EXPCL_DIRECT_DCPARSER
76 #define EXPTP_DIRECT_DCPARSER
77 
78 // Panda defines some assert-type macros. We map those to the standard assert
79 // macro outside of Panda.
80 #define nassertr(condition, return_value) assert(condition)
81 #define nassertr_always(condition, return_value) assert(condition)
82 #define nassertv(condition) assert(condition)
83 #define nassertv_always(condition) assert(condition)
84 
85 // Panda defines a special Filename class. We'll use an ordinary string
86 // instead.
87 typedef std::string Filename;
88 
89 // Panda defines WORDS_BIGENDIAN on a bigendian machine; otherwise, the
90 // machine is assumed to be littleendian. Outside of Panda, you're
91 // responsible for defining this yourself if necessary. #define
92 // WORDS_BIGENDIAN
93 
94 #include <vector>
95 #include <map>
96 #include <set>
97 #define pvector std::vector
98 #define pmap std::map
99 #define pset std::set
100 
101 #include <stdint.h>
102 
103 typedef std::ifstream pifstream;
104 typedef std::ofstream pofstream;
105 typedef std::fstream pfstream;
106 
107 #endif // WITHIN_PANDA
108 
109 // typedef unsigned long CHANNEL_TYPE;
110 typedef uint64_t CHANNEL_TYPE;
111 typedef uint32_t DOID_TYPE;
112 typedef uint32_t ZONEID_TYPE;
113 
114 #endif // DCBASE_H
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:39
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.