dcbase.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. // Filename: dcbase.h
  2. // Created by: drose (05Oct00)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
  8. //
  9. // All use of this software is subject to the terms of the Panda 3d
  10. // Software license. You should have received a copy of this license
  11. // along with this source code; you will also find a current copy of
  12. // the license at http://www.panda3d.org/license.txt .
  13. //
  14. // To contact the maintainers of this program write to
  15. // [email protected] .
  16. //
  17. ////////////////////////////////////////////////////////////////////
  18. #ifndef DCBASE_H
  19. #define DCBASE_H
  20. // This file defines a few headers and stuff necessary for compilation
  21. // of the files in this directory. This is different from most of the
  22. // other source directories within Panda, since the dcparser is
  23. // designed to be compilable outside of Panda (for use by the server
  24. // code). Therefore, it must not depend on including any of the Panda
  25. // header files, and we have to duplicate some setup stuff here.
  26. #ifdef WITHIN_PANDA
  27. // On the other hand, if WITHIN_PANDA is defined, we *are* safely
  28. // within the Panda environment.
  29. #include <directbase.h>
  30. #include <notify.h>
  31. #include <filename.h>
  32. #include <numeric_types.h>
  33. #include "pvector.h"
  34. #include "pmap.h"
  35. #else // WITHIN_PANDA
  36. #ifdef WIN32
  37. /* C4786: 255 char debug symbols */
  38. #pragma warning (disable : 4786)
  39. /* C4503: decorated name length exceeded */
  40. #pragma warning (disable : 4503)
  41. #endif /* WIN32_VC */
  42. #if defined(WIN32)
  43. #include <iostream>
  44. #include <fstream>
  45. #include <iomanip>
  46. #else
  47. #include <iostream.h>
  48. #include <fstream.h>
  49. #include <iomanip.h>
  50. #endif
  51. #include <string>
  52. #include <assert.h>
  53. // These header files are needed to compile dcLexer.cxx, the output
  54. // from flex. flex doesn't create a perfectly windows-friendly source
  55. // file right out of the box.
  56. #ifdef WIN32
  57. #include <io.h>
  58. #include <malloc.h>
  59. #else
  60. #include <unistd.h>
  61. #endif
  62. using namespace std;
  63. // These symbols are used within the Panda environment for exporting
  64. // classes and functions to the scripting language. They're largely
  65. // meaningless if we're not compiling within Panda.
  66. #define PUBLISHED public
  67. #define BEGIN_PUBLISH
  68. #define END_PUBLISH
  69. // Panda defines some assert-type macros. We map those to the
  70. // standard assert macro outside of Panda.
  71. #define nassertr(condition, return_value) assert(condition)
  72. #define nassertv(condition) assert(condition)
  73. // Panda defines these export symbols for building DLL's. Outside of
  74. // Panda, we assume we're not putting this code in a DLL, so we define
  75. // them to nothing.
  76. #define EXPCL_DIRECT
  77. #define EXPTP_DIRECT
  78. // Panda defines a special Filename class. We'll use an ordinary
  79. // string instead.
  80. typedef string Filename;
  81. // Panda defines WORDS_BIGENDIAN on a bigendian machine; otherwise,
  82. // the machine is assumed to be littleendian. Outside of Panda,
  83. // you're responsible for defining this yourself if necessary.
  84. //#define WORDS_BIGENDIAN
  85. #include <vector>
  86. #include <map>
  87. #define pvector vector
  88. #define pmap map
  89. #endif // WITHIN_PANDA
  90. #endif // DCBASE_H