vc6compat.h

Go to the documentation of this file.
00001 #ifndef VC6COMPAT_H
00002 #define VC6COMPAT_H
00003 
00004 #ifdef _MSC_VER //note: should probably check for newer versions
00005                  // without the annoying Visual C++ bugs
00006 namespace NaN {
00007   // define function for generating
00008   // floating point NaNs
00009   inline float nanf(const char *dummy) {
00010     static char *nan="\x00\x00\xc0\x7f";
00011     // what nanf("") returns
00012     return *(reinterpret_cast<float *>(nan));
00013   }
00014 }
00015 
00016 using NaN::nanf;
00017 #define M_PI 3.14159265358979323846264338327950288419716939937508
00018 
00019 #if (_MSC_VER<=1200)
00020 #include <cmath>
00021 #ifndef for
00022 #define for if(0);else for
00023 #endif
00024 
00025 namespace std {
00026   #include <cstdlib>
00027 };
00028 
00029 
00030 inline double abs(double x) {
00031   return fabs(x);
00032 }  
00033 // abs should be overloaded for double
00034 
00035 #endif //_MSC_VER <=1200
00036 #endif // microsoft compiler
00037 
00038 #endif 

Generated on Fri Jul 24 12:49:17 2009 for Xgrayimg Library by  doxygen 1.5.5