Panda3D
Loading...
Searching...
No Matches
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#include "vector_uchar.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 from flex.
55// flex doesn't create a perfectly windows-friendly source file right out of
56// the box.
57#ifdef WIN32
58#include <io.h>
59#include <malloc.h>
60#else
61#include <unistd.h>
62#endif
63
64#define INLINE inline
65
66// These symbols are used within the Panda environment for exporting classes
67// and functions to the scripting language. They're largely meaningless if
68// we're not compiling within Panda.
69#define PUBLISHED public
70#define BEGIN_PUBLISH
71#define END_PUBLISH
72#define BLOCKING
73
74// These control the declspec(dllexport/dllimport) on Windows. When compiling
75// outside of Panda, we assume we aren't part of a DLL.
76#define EXPCL_DIRECT_DCPARSER
77#define EXPTP_DIRECT_DCPARSER
78
79// Panda defines some assert-type macros. We map those to the standard assert
80// macro outside of Panda.
81#define nassertr(condition, return_value) assert(condition)
82#define nassertr_always(condition, return_value) assert(condition)
83#define nassertv(condition) assert(condition)
84#define nassertv_always(condition) assert(condition)
85#define nassert_raise(message) {std::cerr << message << std::endl; abort();}
86
87// Panda defines a special Filename class. We'll use an ordinary string
88// instead.
89typedef std::string Filename;
90
91// Panda defines WORDS_BIGENDIAN on a bigendian machine; otherwise, the
92// machine is assumed to be littleendian. Outside of Panda, you're
93// responsible for defining this yourself if necessary. #define
94// WORDS_BIGENDIAN
95
96#include <vector>
97#include <map>
98#include <set>
99#define pvector std::vector
100#define pmap std::map
101#define pset std::set
102#define vector_uchar std::vector<unsigned char>
103
104#include <stdint.h>
105#include <string.h>
106
107typedef std::ifstream pifstream;
108typedef std::ofstream pofstream;
109typedef std::fstream pfstream;
110
111#endif // WITHIN_PANDA
112
113// typedef unsigned long CHANNEL_TYPE;
114typedef uint64_t CHANNEL_TYPE;
115typedef uint32_t DOID_TYPE;
116typedef uint32_t ZONEID_TYPE;
117
118#endif // DCBASE_H
The name of a file, such as a texture file or an Egg file.
Definition filename.h:44
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.
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.