lib/base/base.h

Go to the documentation of this file.
00001  
00002 /* Copyright (c) 2005-2009, Stefan Eilemann <eile@equalizergraphics.com> 
00003  *
00004  * This library is free software; you can redistribute it and/or modify it under
00005  * the terms of the GNU Lesser General Public License version 2.1 as published
00006  * by the Free Software Foundation.
00007  *  
00008  * This library is distributed in the hope that it will be useful, but WITHOUT
00009  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00010  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00011  * details.
00012  * 
00013  * You should have received a copy of the GNU Lesser General Public License
00014  * along with this library; if not, write to the Free Software Foundation, Inc.,
00015  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00016  */
00017 
00023 #ifndef EQBASE_BASE_H
00024 #define EQBASE_BASE_H
00025 
00026 #include <eq/base/defines.h>
00027 
00028 #ifdef WIN32
00029 #  ifndef WIN32_VC
00030 #    define USE_SYS_TYPES_FD_SET
00031 #  endif
00032 #  define _USE_MATH_DEFINES
00033 #  define _WIN32_WINNT 0x500
00034 #  define WIN32_LEAN_AND_MEAN
00035 #  define NOMINMAX
00036 #  include <Winsock2.h>
00037 #  include <Windows.h>
00038 #  include <windef.h>
00039 #  define EQ_DLLEXPORT __declspec(dllexport) 
00040 #  define EQ_DLLIMPORT __declspec(dllimport)
00041 #  ifdef EQUALIZER_EXPORTS
00042 #    define EQ_EXPORT EQ_DLLEXPORT
00043 #    define EQ_STLEXTERN 
00044 #    define GLEW_BUILD
00045 #  else
00046 #    define EQ_EXPORT EQ_DLLIMPORT
00047 #    define EQ_STLEXTERN extern
00048 #  endif
00049    // Need to predefine server library exports for forward declaration of 
00050    // eqsStartLocalServer
00051 #  ifdef EQUALIZERSERVERLIBRARY_EXPORTS
00052 #    define EQSERVER_EXPORT EQ_DLLEXPORT
00053 #    define EQSERVER_STLEXTERN 
00054 #  else
00055 #    define EQSERVER_EXPORT EQ_DLLIMPORT
00056 #    define EQSERVER_STLEXTERN extern
00057 #  endif
00058 #else // WIN32
00059 #  define EQ_DLLEXPORT 
00060 #  define EQ_DLLIMPORT 
00061 
00062 #  define EQ_EXPORT
00063 #  define EQSERVER_DLLEXPORT 
00064 #  define EQSERVER_DLLIMPORT 
00065 
00066 #  define EQSERVER_EXPORT
00067 #endif
00068 
00069 // Defining our own min/max macros seems to be the only sane way to get this
00070 // functionality across platforms thanks to some screwup in the MS header files.
00071 #define EQ_MAX(a,b) ((a)>(b)?(a):(b)) 
00072 #define EQ_MIN(a,b) ((a)<(b)?(a):(b)) 
00073 
00074 #include <cmath>
00075 #include <cstdio>
00076 #include <cstdlib>
00077 #ifndef WIN32_VC
00078 #  include <stdint.h>
00079 #  include <sys/param.h>  // for MIN/MAX
00080 #endif
00081 
00082 #include <eq/base/types.h>
00083 
00084 // defines
00086 #define EQ_UNDEFINED_UINT32   (0xffffffffu)
00087 //#define EQ_UNDEFINED_FLOAT    (std::numeric_limits<float>::quiet_NaN( ))
00088 //#define EQ_UNDEFINED_INT32    (0x7fffffffu)
00089 
00091 #define EQ_TIMEOUT_INDEFINITE 0
00092 
00093 #ifdef WIN32_VC
00094 
00095 #  define EQ_ALIGN8( var )  __declspec (align (8)) var;
00096 
00097 #  define EQ_ALIGN16( var ) __declspec (align (16)) var;
00098 #else
00099 
00100 #  define EQ_ALIGN8( var )  var __attribute__ ((aligned (8)));
00101 
00102 #  define EQ_ALIGN16( var ) var __attribute__ ((aligned (16)));
00103 #endif
00104 
00105 #define VMMLIB_CUSTOM_CONFIG
00106 #ifndef NDEBUG
00107 #  define VMMLIB_SAFE_ACCESSORS
00108 #endif
00109 #define VMMLIB_ALIGN( var ) var
00110 
00111 #ifdef __GNUC__
00112 #  if (( __GNUC__ > 4 ) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 0)) )
00113 #    define EQ_GCC_4_0_OR_LATER
00114 #  endif
00115 #  if (( __GNUC__ > 4 ) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) )
00116 #    define EQ_GCC_4_1_OR_LATER
00117 #  endif
00118 #  if (( __GNUC__ > 4 ) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) )
00119 #    define EQ_GCC_4_2_OR_LATER
00120 #  endif
00121 #  if (( __GNUC__ > 4 ) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) )
00122 #    define EQ_GCC_4_3_OR_LATER
00123 #  endif
00124 #  if (( __GNUC__ > 4 ) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) )
00125 #    define EQ_GCC_4_4_OR_LATER
00126 #  endif
00127 #  if (( __GNUC__ > 4 ) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) )
00128 #    define EQ_GCC_4_5_OR_LATER
00129 #  endif
00130 #endif // GCC
00131 
00132 #endif //EQBASE_BASE_H
Generated on Sat Feb 6 12:59:41 2010 for Equalizer 0.9.1 by  doxygen 1.6.1