00001
00002
00003
00004
00005 #ifndef EQBASE_BASE_H
00006 #define EQBASE_BASE_H
00007
00008 #include <eq/base/defines.h>
00009
00010 #ifdef WIN32
00011 # define _USE_MATH_DEFINES
00012 # define _WIN32_WINNT 0x500
00013 # include <Winsock2.h>
00014 # include <Windows.h>
00015 # include <windef.h>
00016 # define EQ_DLLEXPORT __declspec(dllexport)
00017 # define EQ_DLLIMPORT __declspec(dllimport)
00018 # ifdef EQUALIZER_EXPORTS
00019 # define EQ_EXPORT EQ_DLLEXPORT
00020 # define EQ_STLEXTERN
00021 # define GLEW_BUILD
00022 # else
00023 # define EQ_EXPORT EQ_DLLIMPORT
00024 # define EQ_STLEXTERN extern
00025 # endif
00026
00027
00028 # ifdef EQUALIZERSERVERLIBRARY_EXPORTS
00029 # define EQSERVER_EXPORT EQ_DLLEXPORT
00030 # define EQSERVER_STLEXTERN
00031 # else
00032 # define EQSERVER_EXPORT EQ_DLLIMPORT
00033 # define EQSERVER_STLEXTERN extern
00034 # endif
00035 #else // WIN32
00036 # define EQ_DLLEXPORT
00037 # define EQ_DLLIMPORT
00038 # define EQ_EXPORT
00039 # define EQSERVER_DLLEXPORT
00040 # define EQSERVER_DLLIMPORT
00041 # define EQSERVER_EXPORT
00042 #endif
00043
00044
00045
00046 #define EQ_MAX(a,b) ((a)>(b)?(a):(b))
00047 #define EQ_MIN(a,b) ((a)<(b)?(a):(b))
00048
00049 #include <cmath>
00050 #include <cstdio>
00051 #include <cstdlib>
00052 #ifndef WIN32_VC
00053 # include <stdint.h>
00054 # include <sys/param.h>
00055 #endif
00056
00057 #include <eq/base/types.h>
00058
00059
00060 #define EQ_UNDEFINED_UINT32 (0xffffffffu)
00061
00062
00063 #define EQ_TIMEOUT_INDEFINITE 0
00064 #define EQ_OBJECT_CAST( type, object ) \
00065 static_cast<type>( object ); \
00066 EQASSERTINFO( object && !dynam!ic_cast<type>( object ), \
00067 "Object is not of type " << #type );
00068
00069 #ifdef WIN32_VC
00070 # define EQ_ALIGN8( var ) __declspec (align (8)) var;
00071 # define EQ_ALIGN16( var ) __declspec (align (16)) var;
00072 #else
00073 # define EQ_ALIGN8( var ) var __attribute__ ((aligned (8)));
00074 # define EQ_ALIGN16( var ) var __attribute__ ((aligned (16)));
00075 #endif
00076
00077
00078
00079 #endif //EQBASE_BASE_H