00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef PANDABASE_CC_H
00020 #define PANDABASE_CC_H
00021
00022
00023
00024
00025
00026 #ifdef CPPPARSER
00027 #include <iostream>
00028 #include <string>
00029
00030 using namespace std;
00031
00032 #define INLINE inline
00033 #define TYPENAME typename
00034
00035 #define EXPORT_TEMPLATE_CLASS(expcl, exptp, classname)
00036
00037
00038
00039
00040
00041 #define PUBLISHED __published
00042
00043 typedef int streamsize;
00044 typedef int ios_openmode;
00045 typedef int ios_fmtflags;
00046 typedef int ios_iostate;
00047 typedef int ios_seekdir;
00048
00049 #else // CPPPARSER
00050
00051 #ifdef HAVE_IOSTREAM
00052 #include <iostream>
00053 #include <fstream>
00054 #include <iomanip>
00055 #else
00056 #include <iostream.h>
00057 #include <fstream.h>
00058 #include <iomanip.h>
00059 #endif
00060
00061 #ifdef HAVE_SSTREAM
00062 #include <sstream>
00063 #else
00064 #include "fakestringstream.h"
00065 #endif
00066
00067 #ifdef HAVE_NEW
00068 #include <new>
00069 #endif
00070
00071 #include <string>
00072
00073 #ifdef HAVE_NAMESPACE
00074 using namespace std;
00075 #endif
00076
00077 #ifdef HAVE_TYPENAME
00078 #define TYPENAME typename
00079 #else
00080 #define TYPENAME
00081 #endif
00082
00083 #ifndef HAVE_WSTRING
00084
00085 typedef basic_string<wchar_t> wstring;
00086 #endif
00087
00088 #ifndef HAVE_STREAMSIZE
00089
00090 typedef int streamsize;
00091 #endif
00092
00093 #ifndef HAVE_IOS_TYPEDEFS
00094 typedef int ios_openmode;
00095 typedef int ios_fmtflags;
00096 typedef int ios_iostate;
00097
00098 typedef ios::seek_dir ios_seekdir;
00099 #else
00100 typedef ios::openmode ios_openmode;
00101 typedef ios::fmtflags ios_fmtflags;
00102 typedef ios::iostate ios_iostate;
00103 typedef ios::seekdir ios_seekdir;
00104 #endif
00105
00106
00107 #if defined(WIN32_VC) && defined(FORCE_INLINING)
00108
00109
00110
00111 #define INLINE __forceinline
00112 #else
00113 #define INLINE inline
00114 #endif
00115
00116 #if defined(WIN32_VC) && !defined(LINK_ALL_STATIC) && defined(EXPORT_TEMPLATES)
00117
00118
00119
00120
00121 #define EXPORT_TEMPLATE_CLASS(expcl, exptp, classname) \
00122 exptp template class expcl classname;
00123 #else
00124 #define EXPORT_TEMPLATE_CLASS(expcl, exptp, classname)
00125 #endif
00126
00127
00128
00129
00130
00131 #define PUBLISHED public
00132
00133 #endif // CPPPARSER
00134
00135
00136
00137
00138 #ifndef NDEBUG
00139 EXPCL_DTOOL void *default_operator_new(size_t size);
00140 EXPCL_DTOOL void default_operator_delete(void *ptr);
00141
00142 extern EXPCL_DTOOL void *(*global_operator_new)(size_t size);
00143 extern EXPCL_DTOOL void (*global_operator_delete)(void *ptr);
00144
00145 #ifdef GLOBAL_OPERATOR_NEW_EXCEPTIONS
00146
00147
00148
00149
00150 INLINE void *operator new(size_t size) throw (std::bad_alloc) {
00151 return (*global_operator_new)(size);
00152 }
00153 INLINE void *operator new[](size_t size) throw (std::bad_alloc) {
00154 return (*global_operator_new)(size);
00155 }
00156
00157 INLINE void operator delete(void *ptr) throw() {
00158 (*global_operator_delete)(ptr);
00159 }
00160 INLINE void operator delete[](void *ptr) throw() {
00161 (*global_operator_delete)(ptr);
00162 }
00163 #else // GLOBAL_OPERATOR_NEW_EXCEPTIONS
00164
00165
00166
00167 INLINE void *operator new(size_t size) {
00168 return (*global_operator_new)(size);
00169 }
00170 INLINE void *operator new[](size_t size) {
00171 return (*global_operator_new)(size);
00172 }
00173
00174 INLINE void operator delete(void *ptr) {
00175 (*global_operator_delete)(ptr);
00176 }
00177 INLINE void operator delete[](void *ptr) {
00178 (*global_operator_delete)(ptr);
00179 }
00180
00181 #endif // GLOBAL_OPERATOR_NEW_EXCEPTIONS
00182 #endif // NDEBUG
00183
00184 #endif