Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

vuSimpleTypes.h

Go to the documentation of this file.
00001 #ifndef _VUSIMPLETYPES_H_
00002 #define _VUSIMPLETYPES_H_
00003 
00004 typedef unsigned long  dword;
00005 typedef unsigned short word;
00006 typedef unsigned char  byte;
00007 
00008 // Those are fun to have ;-) Emacs reads them and takes you to the position.
00009 #define DEBUGMSG(msg) cerr << __FILE__ << ":" << __LINE__ << ": " << msg<<endl
00010 #define DEBUG cerr << __FILE__ << ":" << __LINE__ << ": " << endl
00011 
00012 #define REDIRECT_CERR(file) \
00013 { \
00014   streambuf *psbuf; \
00015   ofstream *filestr = new ofstream(file); \
00016   psbuf = filestr->rdbuf(); \
00017   cerr.rdbuf(psbuf); \
00018   } // here we leak ;-)
00019 
00025 inline dword swizzle(dword a)
00026 {
00027     register dword v;
00028     v  = (a & 0x000000ff) << 24;
00029     v |= (a & 0x0000ff00) << 8;
00030     v |= (a & 0x00ff0000) >> 8;
00031     v |= (a & 0xff000000) >> 24;
00032     return v;
00033 }
00034 
00039 inline word swizzle(word a)
00040 {
00041     register word v;
00042     v  = (a & 0x00ff) << 8;
00043     v |= (a & 0xff00) >> 8;
00044     return v;
00045 }
00046 
00047 #if !defined(LINUX)
00048 
00049 #ifndef M_E
00050 #define M_E             2.7182818284590452354
00051 #endif
00052 #ifndef M_LOG2E
00053 #define M_LOG2E         1.4426950408889634074
00054 #endif
00055 #ifndef M_LOG10E
00056 #define M_LOG10E        0.43429448190325182765
00057 #endif
00058 #ifndef M_LN2
00059 #define M_LN2           0.69314718055994530942
00060 #endif
00061 #ifndef M_LN10
00062 #define M_LN10          2.30258509299404568402
00063 #endif
00064 #ifndef M_PI
00065 #define M_PI            3.14159265358979323846
00066 #endif
00067 #ifndef M_PI_2
00068 #define M_PI_2          1.57079632679489661923
00069 #endif
00070 #ifndef M_PI_4
00071 #define M_PI_4          0.78539816339744830962
00072 #endif
00073 #ifndef M_1_PI
00074 #define M_1_PI          0.31830988618379067154
00075 #endif
00076 #ifndef M_2_PI
00077 #define M_2_PI          0.63661977236758134308
00078 #endif
00079 #ifndef M_2_SQRTPI
00080 #define M_2_SQRTPI      1.12837916709551257390
00081 #endif
00082 #ifndef M_SQRT2
00083 #define M_SQRT2         1.41421356237309504880
00084 #endif
00085 #ifndef M_SQRT1_2
00086 #define M_SQRT1_2       0.70710678118654752440
00087 #endif
00088 
00089 #endif  // of !def LINUX
00090 
00091 #ifdef CHECKNDELETE
00092 #undef CHECKNDELETE
00093 #endif
00094 
00095 #define CHECKNDELETE(_object_)  \
00096 {                         \
00097   if (_object_ != NULL) { \
00098     delete _object_;      \
00099     _object_ = NULL;      \
00100   }                       \
00101 }                         \
00102 
00103 /*
00104 inline void THROW(const char *msg)
00105 {
00106   cerr << "EXCEPTION: " << msg << endl;
00107   throw msg;
00108 }
00109 */
00110 
00111 #endif /* _VUSIMPLETYPES_H_ */

Generated on Wed Dec 15 21:20:36 2004 for vuVolume by  doxygen 1.3.9.1