00001 #if !defined (_SpatialGeneral_h)
00002 #define _SpatialGeneral_h
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 #if !defined(OO_MACHINE_H) && !defined(OO_CONFIG_H) && !defined(SXGENERAL_H)
00048 typedef char int8;
00049 typedef unsigned char uint8;
00050 typedef short int int16;
00051 typedef unsigned short int uint16;
00052 typedef int int32;
00053 typedef unsigned int uint32;
00054 typedef float float32;
00055 typedef double float64;
00056 #ifdef _WIN32
00057 typedef __int64 int64;
00058 typedef unsigned __int64 uint64;
00059 #else
00060 typedef long long int64;
00061 typedef unsigned long long uint64;
00062 #endif
00063 #endif
00064
00065 #if defined(__sun) || defined(__sgi)
00066 # define SPATIALBIGENDIAN
00067 #endif
00068
00069 #define IDSIZE 64
00070 #define HTMNAMEMAX 32
00071 #define HTMMAXDEPTH 25
00072 #define MAX_SQL_DEPTH 20
00073 #define HTMMAXKEEP 12
00074 #define HTMMAXBIT 14
00075
00076
00077
00078 # if !defined(SXGENERAL_H) && !defined(__sgi) && !defined(__linux) && !defined(_WIN32)
00079 # ifdef __unix
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103 # endif
00104 # endif
00105
00106
00107
00108 const float64 gPi = 3.1415926535897932385E0 ;
00109 const float64 gPr = gPi/180.0;
00110 const float64 gEpsilon = 1.0E-15;
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126 #if defined(__macosx)
00127 # define LINKAGE
00128 #endif
00129
00130 #if defined(__unix)
00131
00132 # if defined(__osf__)
00133 # define SpatialDigitalUnix 1
00134 # define SpatialStandardTemplate 1
00135 # elif defined(__sgi)
00136 # define SpatialSGI 1
00137 # define SpatialPragmaTemplateSGI 1
00138 # elif defined(__sun)
00139 # define SpatialSUN 1
00140 # define SpatialStandardTemplate 1
00141 # elif defined(__linux)
00142 # define SpatialLinux 1
00143 # define SpatialStandardTemplate 1
00144 # endif
00145 # define LINKAGE
00146
00147 #elif defined(_WIN32)
00148 # define SpatialWinNT 1
00149 # define SpatialWINTemplate 1
00150
00151 # pragma warning(disable: 4251)
00152
00153
00154
00155 # ifdef _EXPORTING
00156 # define LINKAGE __declspec(dllexport)
00157 # endif
00158 # ifdef _IMPORTING
00159 # define LINKAGE __declspec(dllimport)
00160 # endif
00161
00162 #endif
00163
00164 #ifndef SpatialWinNT
00165 # define IDHIGHBIT 0x8000000000000000LL
00166 # define IDHIGHBIT2 0x4000000000000000LL
00167 # ifdef SpatialDigitalUnix
00168 # define PRINTID(x) printf("%lu",(x))
00169 # define PRINTID_HEX(x) printf("%lX",(x))
00170 # else
00171 # define PRINTID(x) printf("%llu",(x))
00172 # define PRINTID_HEX(x) printf("%llX",(x))
00173 # endif
00174 #else
00175 # define PRINTID(x) printf("%I64u",(x))
00176 # define PRINTID_HEX(x) printf("%I64X",(x))
00177 #endif
00178
00179
00180
00181 #if !defined(SPATIALBIGENDIAN) && !defined(SXGENERAL_H)
00182 # define SWAP(a,b) { a^=b; b^=a; a^=b; }
00183
00184
00185
00186 #endif
00187
00188 #if defined(_WIN32) && defined(_INC_IOSTREAM)
00189 LINKAGE ostream& operator<<(ostream& os, const int64 &i64);
00190 LINKAGE ostream& operator<<(ostream& os, const uint64 &ui64);
00191 #endif
00192
00193 #endif