00001
00004
00005
00006
00007
00008 #ifndef _cel_platform_h_
00009 #define _cel_platform_h_
00010
00011 #if defined(__GNUC__)
00012
00013 #if __GNUC__ < 3
00014 #error "cel_platform.h only supports g++ 3.2 or later."
00015 #endif
00016 #if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
00017
00018
00019
00020 #define DONT_QUALIFY_SPECIALIZED_TEMPLATE
00021 #endif
00022 #endif
00023
00032 #ifndef _CEL_DEBUG_
00033 #define _CEL_DEBUG_ 0
00034 #endif
00035
00073 #if defined(__CYGWIN__)
00074
00075
00076
00077 #define CEL_ENV_CYGWIN 1
00078 #define CEL_ENV_POSIX 1
00079 #elif defined(_WIN32) || defined(_WIN64) || defined(__MINGW32__)
00080
00081
00082
00083 #define CEL_ENV_WINDOWS 1
00084 #if defined(_WIN64)
00085 #define CEL_ENV_WIN64 1
00086 #endif
00087 #elif defined(__linux__)
00088
00089
00090
00091 #define CEL_ENV_LINUX 1
00092 #define CEL_ENV_POSIX 1
00093 #elif defined(__MACH__)
00094
00095
00096
00097 #define CEL_ENV_MACOSX 1
00098 #define CEL_ENV_POSIX 1
00099 #elif defined(__sun) || defined(sun)
00100
00101
00102
00103 #define CEL_ENV_SOLARIS 1
00104 #define CEL_ENV_POSIX 1
00105 #elif defined(__FreeBSD__)
00106
00107
00108
00109 #define CEL_ENV_FREEBSD 1
00110 #define CEL_ENV_POSIX 1
00111 #elif defined(_AIX)
00112
00113
00114
00115 #define CEL_ENV_AIX 1
00116 #define CEL_ENV_POSIX 1
00117 #elif defined(hpux) || defined(__hpux__) || defined(__hpux)
00118
00119
00120
00121 #define CEL_ENV_HPUX 1
00122 #define CEL_ENV_POSIX 1
00123 #else
00124
00125
00126
00127 #error "Please set Platform Macro!"
00128 #endif
00129
00130 #ifndef CEL_ENV_WINDOWS
00131 #define CEL_ENV_WINDOWS 0
00132 #endif
00133
00134 #ifndef CEL_ENV_CYGWIN
00135 #define CEL_ENV_CYGWIN 0
00136 #endif
00137
00138 #ifndef CEL_ENV_MACOSX
00139 #define CEL_ENV_MACOSX 0
00140 #endif
00141
00142 #ifndef CEL_ENV_LINUX
00143 #define CEL_ENV_LINUX 0
00144 #endif
00145
00146 #ifndef CEL_ENV_SOLARIS
00147 #define CEL_ENV_SOLARIS 0
00148 #endif
00149
00150 #ifndef CEL_ENV_FREEBSD
00151 #define CEL_ENV_FREEBSD 0
00152 #endif
00153
00154 #ifndef CEL_ENV_AIX
00155 #define CEL_ENV_AIX 0
00156 #endif
00157
00158 #ifndef CEL_ENV_HPUX
00159 #define CEL_ENV_HPUX 0
00160 #endif
00161
00162 #ifndef CEL_ENV_POSIX
00163 #define CEL_ENV_POSIX 0
00164 #endif
00165
00170 #ifdef __GNUG__ // g++
00171 #define CEL_RESTRICT __restrict__
00172 #elif defined(__INTEL_COMPILER) // Intel C++ Compiler
00173 #define CEL_RESTRICT restrict
00174 #elif _MSC_VER >= 1400 // Visual C++ 2005 compiler or later
00175 #define CEL_RESTRICT __restrict
00176 #else
00177 #define CEL_RESTRICT
00178 #endif
00179
00180 #if _MSC_VER >= 1400 // Visual C++ 2005 compiler or later
00181 #define CEL_RESTRICT_RETVAL __declspec(restrict)
00182 #define CEL_NOALIAS __declspec(noalias)
00183 #else
00184 #define CEL_RESTRICT_RETVAL
00185 #define CEL_NOALIAS
00186 #endif
00187
00188 #if defined(DEBUG) || defined(_DEBUG) || _CEL_DEBUG_
00189 #include <cassert>
00190 #define CEL_ASSUME(cond) assert(cond)
00191 #else
00192 #if _MSC_VER >= 1400 // Visual C++ 2005 compiler or later
00193 #define CEL_ASSUME(cond) __assume(cond)
00194 #else
00195 #define CEL_ASSUME(cond)
00196 #endif
00197 #endif
00198
00199 #endif // _cel_platform_h_