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 # define copysign _copysign
00067
00068 # pragma warning(disable: 4786) // identifier was truncated to '255' characters
00069 # pragma warning(disable: 4244) // conversion from double to float
00070 # pragma warning(disable: 4305) //
00071
00072 # else
00073 # error What version of MSVC++ is this?
00074 # endif
00075
00076 # define SG_COMPILER_STR "Microsoft Visual C++ version " SG_STRINGIZE(_MSC_VER)
00077
00078 #endif // _MSC_VER
00079
00080
00081
00082
00083
00084 #if defined ( sgi ) && !defined( __GNUC__ )
00085 # if (_COMPILER_VERSION < 740)
00086 # error Need MipsPro 7.4.0 or higher now
00087 # endif
00088
00089 #define SG_HAVE_NATIVE_SGI_COMPILERS
00090
00091 #pragma set woff 1001,1012,1014,1116,1155,1172,1174
00092 #pragma set woff 1401,1460,1551,1552,1681
00093
00094 #ifdef __cplusplus
00095 # pragma set woff 1682,3303
00096 # pragma set woff 3624
00097 #endif
00098
00099 # define SG_COMPILER_STR "SGI MipsPro compiler version " SG_STRINGIZE(_COMPILER_VERSION)
00100
00101 #endif // Native SGI compilers
00102
00103
00104 #if defined (__sun)
00105 # include <strings.h>
00106 # include <memory.h>
00107 # if defined ( __cplusplus )
00108
00109 extern "C" {
00110 extern void *memmove(void *, const void *, size_t);
00111 }
00112 # else
00113 extern void *memmove(void *, const void *, size_t);
00114 # endif // __cplusplus
00115
00116 # if !defined( __GNUC__ )
00117 # define SG_COMPILER_STR "Sun compiler version " SG_STRINGIZE(__SUNPRO_CC)
00118 # endif
00119
00120 #endif // sun
00121
00122
00123
00124
00125 #if defined(__ICC) || defined (__ECC)
00126 # define SG_COMPILER_STR "Intel C++ version " SG_STRINGIZE(__ICC)
00127 #endif // __ICC
00128
00129
00130
00131
00132
00133 #ifdef __APPLE__
00134 inline int (isnan)(double r) { return !(r <= 0 || r >= 0); }
00135 #else
00136
00137 #endif
00138
00139
00140
00141
00142
00143
00144 #endif // _SG_COMPILER_H
00145