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 #  define _USE_MATH_DEFINES
00030 #  define _WIN32_WINNT 0x500
00031 #  define WIN32_LEAN_AND_MEAN
00032 #  define NOMINMAX
00033 #  include <Winsock2.h>
00034 #  include <Windows.h>
00035 #  include <windef.h>
00036 #  define EQ_DLLEXPORT __declspec(dllexport) 
00037 #  define EQ_DLLIMPORT __declspec(dllimport)
00038 #  ifdef EQUALIZER_EXPORTS
00039 #    define EQ_EXPORT EQ_DLLEXPORT
00040 #    define EQ_STLEXTERN 
00041 #    define GLEW_BUILD
00042 #  else
00043 #    define EQ_EXPORT EQ_DLLIMPORT
00044 #    define EQ_STLEXTERN extern
00045 #  endif
00046    // Need to predefine server library exports for forward declaration of 
00047    // eqsStartLocalServer
00048 #  ifdef EQUALIZERSERVERLIBRARY_EXPORTS
00049 #    define EQSERVER_EXPORT EQ_DLLEXPORT
00050 #    define EQSERVER_STLEXTERN 
00051 #  else
00052 #    define EQSERVER_EXPORT EQ_DLLIMPORT
00053 #    define EQSERVER_STLEXTERN extern
00054 #  endif
00055 #else // WIN32
00056 #  define EQ_DLLEXPORT 
00057 #  define EQ_DLLIMPORT 
00058 
00059 #  define EQ_EXPORT
00060 #  define EQSERVER_DLLEXPORT 
00061 #  define EQSERVER_DLLIMPORT 
00062 
00063 #  define EQSERVER_EXPORT
00064 #endif
00065 
00066 // Defining our own min/max macros seems to be the only sane way to get this
00067 // functionality across platforms thanks to some screwup in the MS header files.
00068 #define EQ_MAX(a,b) ((a)>(b)?(a):(b)) 
00069 #define EQ_MIN(a,b) ((a)<(b)?(a):(b)) 
00070 
00071 #include <cmath>
00072 #include <cstdio>
00073 #include <cstdlib>
00074 #ifndef WIN32_VC
00075 #  include <stdint.h>
00076 #  include <sys/param.h>  // for MIN/MAX
00077 #endif
00078 
00079 #include <eq/base/types.h>
00080 
00081 // defines
00083 #define EQ_UNDEFINED_UINT32   (0xffffffffu)
00084 //#define EQ_UNDEFINED_FLOAT    (std::numeric_limits<float>::quiet_NaN( ))
00085 //#define EQ_UNDEFINED_INT32    (0x7fffffffu)
00086 
00088 #define EQ_TIMEOUT_INDEFINITE 0
00089 
00090 #ifdef WIN32_VC
00091 
00092 #  define EQ_ALIGN8( var )  __declspec (align (8)) var;
00093 
00094 #  define EQ_ALIGN16( var ) __declspec (align (16)) var;
00095 #else
00096 
00097 #  define EQ_ALIGN8( var )  var __attribute__ ((aligned (8)));
00098 
00099 #  define EQ_ALIGN16( var ) var __attribute__ ((aligned (16)));
00100 #endif
00101 
00102 
00103 
00104 #endif //EQBASE_BASE_H
Generated on Mon Aug 10 18:58:31 2009 for Equalizer 0.9 by  doxygen 1.5.8