00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef __PEONPLATFORM_H_
00028 #define __PEONPLATFORM_H_
00029
00030
00031 namespace peon {
00032
00033
00034
00035 #define PEON_PLATFORM_WIN32 1
00036 #define PEON_PLATFORM_LINUX 2
00037 #define PEON_PLATFORM_APPLE 3
00038
00039 #define PEON_COMPILER_MSVC 1
00040 #define PEON_COMPILER_GNUC 2
00041 #define PEON_COMPILER_BORL 3
00042
00043 #define PEON_ENDIAN_LITTLE 1
00044 #define PEON_ENDIAN_BIG 2
00045
00046 #define PEON_ARCHITECTURE_32 1
00047 #define PEON_ARCHITECTURE_64 2
00048
00049
00050
00051 #if defined( _MSC_VER )
00052 # define PEON_COMPILER PEON_COMPILER_MSVC
00053 # define PEON_COMP_VER _MSC_VER
00054
00055 #elif defined( __GNUC__ )
00056 # define PEON_COMPILER PEON_COMPILER_GNUC
00057 # define PEON_COMP_VER (((__GNUC__)*100) + \
00058 (__GNUC_MINOR__*10) + \
00059 __GNUC_PATCHLEVEL__)
00060
00061 #elif defined( __BORLANDC__ )
00062 # define PEON_COMPILER PEON_COMPILER_BORL
00063 # define PEON_COMP_VER __BCPLUSPLUS__
00064
00065 #else
00066 # pragma error "No known compiler. Abort! Abort!"
00067
00068 #endif
00069
00070
00071 #if PEON_COMPILER == PEON_COMPILER_MSVC
00072 # if PEON_COMP_VER >= 1200
00073 # define FORCEINLINE __forceinline
00074 # endif
00075 #else
00076 # define FORCEINLINE __inline
00077 #endif
00078
00079
00080
00081 #if defined( __WIN32__ ) || defined( _WIN32 )
00082 # define PEON_PLATFORM PEON_PLATFORM_WIN32
00083
00084 #elif defined( __APPLE_CC__)
00085 # define PEON_PLATFORM PEON_PLATFORM_APPLE
00086
00087 #else
00088 # define PEON_PLATFORM PEON_PLATFORM_LINUX
00089 #endif
00090
00091
00092 #if defined(__x86_64__)
00093 # define PEON_ARCH_TYPE PEON_ARCHITECTURE_64
00094 #else
00095 # define PEON_ARCH_TYPE PEON_ARCHITECTURE_32
00096 #endif
00097
00098
00099
00100 #define PEON_QUOTE_INPLACE(x) # x
00101 #define PEON_QUOTE(x) PEON_QUOTE_INPLACE(x)
00102 #define PEON_WARN( x ) message( __FILE__ "(" QUOTE( __LINE__ ) ") : " x "\n" )
00103
00104
00105
00106 #if PEON_PLATFORM == PEON_PLATFORM_WIN32
00107
00108
00109
00110 # if defined( __MINGW32__ )
00111
00112 # define _PeonExport
00113 # define _PeonPrivate
00114 # else
00115 # if defined( PEON_NONCLIENT_BUILD )
00116 # define _PeonExport __declspec( dllexport )
00117 # else
00118 # define _PeonExport __declspec( dllimport )
00119 # endif
00120 # define _PeonPrivate
00121 # endif
00122
00123 # ifdef _DEBUG
00124 # define PEON_DEBUG_MODE 1
00125 # else
00126 # define PEON_DEBUG_MODE 0
00127 # endif
00128
00129 #if defined( __MINGW32__ )
00130 #define EXT_HASH
00131 #else
00132 #define snprintf _snprintf
00133 #define vsnprintf _vsnprintf
00134 #endif
00135
00136
00137 #endif
00138
00139
00140
00141
00142
00143
00144
00145 #if PEON_PLATFORM == PEON_PLATFORM_LINUX || PEON_PLATFORM == PEON_PLATFORM_APPLE
00146
00147
00148 # if PEON_COMP_VER >= 400
00149 # define _PeonExport __attribute__ ((visibility("default")))
00150 # define _PeonPrivate __attribute__ ((visibility("hidden")))
00151 # else
00152 # define _PeonExport
00153 # define _PeonPrivate
00154 # endif
00155
00156
00157 # define stricmp strcasecmp
00158
00159
00160
00161 # ifdef DEBUG
00162 # define PEON_DEBUG_MODE 1
00163 # else
00164 # define PEON_DEBUG_MODE 0
00165 # endif
00166
00167
00168
00169 #endif
00170
00171
00172
00173
00174
00175
00176
00177 #ifdef CONFIG_BIG_ENDIAN
00178 # define PEON_ENDIAN PEON_ENDIAN_BIG
00179 #else
00180 # define PEON_ENDIAN PEON_ENDIAN_LITTLE
00181 #endif
00182
00183
00184 typedef unsigned int uint32;
00185 typedef unsigned short uint16;
00186 typedef unsigned char uint8;
00187
00188 }
00189
00190 #endif
00191
00192