00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00031 #ifndef _SG_COMPILER_H
00032 #define _SG_COMPILER_H
00033
00034
00035
00036
00037
00038
00039 #define SG_STRINGIZE(X) SG_DO_STRINGIZE(X)
00040 #define SG_DO_STRINGIZE(X) #X
00041
00042 #ifdef __GNUC__
00043 # if __GNUC__ < 3
00044 # error Time to upgrade. GNU compilers < 3.0 not supported
00045 # elif (__GNUC__ == 3) && (__GNUC_MINOR__ < 4)
00046 # warning GCC compilers prior to 3.4 are suspect
00047 # endif
00048
00049 # define SG_COMPILER_STR "GNU C++ version " SG_STRINGIZE(__GNUC__) "." SG_STRINGIZE(__GNUC_MINOR__)
00050 #endif // __GNUC__
00051
00052
00053 #if defined(__KCC)
00054 # define SG_COMPILER_STR "Kai C++ version " SG_STRINGIZE(__KCC_VERSION)
00055 #endif // __KCC
00056
00057
00058
00059
00060 #ifdef _MSC_VER
00061 # define bcopy(from, to, n) memcpy(to, from, n)
00062
00063 # if _MSC_VER >= 1200 // msvc++ 6.0 or greater
00064 # define isnan _isnan
00065 # define snprintf _snprintf
00066 # if _MSC_VER < 1500
00067 # define vsnprintf _vsnprintf
00068 # endif
00069 # define copysign _copysign
00070
00071 # pragma warning(disable: 4786) // identifier was truncated to '255' characters
00072 # pragma warning(disable: 4244) // conversion from double to float
00073 # pragma warning(disable: 4305) //
00074
00075 # else
00076 # error What version of MSVC++ is this?
00077 # endif
00078
00079 # define SG_COMPILER_STR "Microsoft Visual C++ version " SG_STRINGIZE(_MSC_VER)
00080
00081 #endif // _MSC_VER
00082
00083
00084
00085
00086
00087 #if defined ( sgi ) && !defined( __GNUC__ )
00088 # if (_COMPILER_VERSION < 740)
00089 # error Need MipsPro 7.4.0 or higher now
00090 # endif
00091
00092 #define SG_HAVE_NATIVE_SGI_COMPILERS
00093
00094 #pragma set woff 1001,1012,1014,1116,1155,1172,1174
00095 #pragma set woff 1401,1460,1551,1552,1681
00096
00097 #ifdef __cplusplus
00098 # pragma set woff 1682,3303
00099 # pragma set woff 3624
00100 #endif
00101
00102 # define SG_COMPILER_STR "SGI MipsPro compiler version " SG_STRINGIZE(_COMPILER_VERSION)
00103
00104 #endif // Native SGI compilers
00105
00106
00107 #if defined (__sun)
00108 # include <strings.h>
00109 # include <memory.h>
00110 # if defined ( __cplusplus )
00111
00112 extern "C" {
00113 extern void *memmove(void *, const void *, size_t);
00114 }
00115 # else
00116 extern void *memmove(void *, const void *, size_t);
00117 # endif // __cplusplus
00118
00119 # if !defined( __GNUC__ )
00120 # define SG_COMPILER_STR "Sun compiler version " SG_STRINGIZE(__SUNPRO_CC)
00121 # endif
00122
00123 #endif // sun
00124
00125
00126
00127
00128 #if defined(__ICC) || defined (__ECC)
00129 # define SG_COMPILER_STR "Intel C++ version " SG_STRINGIZE(__ICC)
00130 #endif // __ICC
00131
00132
00133
00134
00135
00136 #ifdef __APPLE__
00137 # ifdef __GNUC__
00138 # if ( __GNUC__ > 3 ) || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 3 )
00139 inline int (isnan)(double r) { return !(r <= 0 || r >= 0); }
00140 # else
00141
00142
00143
00144 extern "C" int (isnan)(double);
00145 extern "C" int (isinf)(double);
00146 # endif
00147 # else
00148 inline int (isnan)(double r) { return !(r <= 0 || r >= 0); }
00149 # endif
00150 #endif
00151
00152 #if defined (__FreeBSD__)
00153 # if __FreeBSD_version < 500000
00154 extern "C" {
00155 inline int isnan(double r) { return !(r <= 0 || r >= 0); }
00156 }
00157 # endif
00158 #endif
00159
00160 #if defined (__CYGWIN__)
00161 # include <ieeefp.h>
00162 #endif
00163
00164
00165
00166
00167
00168
00169 #endif // _SG_COMPILER_H
00170