00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __NR_PLATFORM_H_
00018 #define __NR_PLATFORM_H_
00019
00020 #ifdef HAVE_CONFIG_H
00021 #include "config.h"
00022 #endif
00023
00024
00025
00026 #define NR_PLATFORM_WIN32 1
00027 #define NR_PLATFORM_LINUX 2
00028 #define NR_PLATFORM_APPLE 3
00029 #define NR_PLATFORM_NETWARE 4
00030 #define NR_PLATFORM_OS2 5
00031
00032 #define NR_COMPILER_MSVC 1
00033 #define NR_COMPILER_GNUC 2
00034 #define NR_COMPILER_BORL 3
00035
00036 #define NR_ENDIAN_LITTLE 1
00037 #define NR_ENDIAN_BIG 2
00038
00039 #define NR_ARCHITECTURE_32 1
00040 #define NR_ARCHITECTURE_64 2
00041
00042
00043
00044 #if defined( _MSC_VER )
00045 # define NR_COMPILER NR_COMPILER_MSVC
00046 # define NR_COMP_VER _MSC_VER
00047
00048 #elif defined( __GNUC__ )
00049 # define NR_COMPILER NR_COMPILER_GNUC
00050 # define NR_COMP_VER (((__GNUC__)*100)+__GNUC_MINOR__)
00051
00052 #elif defined( __BORLANDC__ )
00053 # define NR_COMPILER NR_COMPILER_BORL
00054 # define NR_COMP_VER __BCPLUSPLUS__
00055
00056 #else
00057 # pragma warning "No known compiler. Behaivor is not defined :-)"
00058
00059 #endif
00060
00061
00062 #if NR_COMPILER == NR_COMPILER_MSVC
00063 # if NR_COMP_VER >= 1200
00064 # define NR_FORCEINLINE __forceinline
00065 # endif
00066 #else
00067 # define NR_FORCEINLINE __inline
00068 #endif
00069
00070
00071
00072 #if defined( __WIN32__ ) || defined( _WIN32 )
00073 # define NR_PLATFORM NR_PLATFORM_WIN32
00074 #elif defined( __APPLE_CC__)
00075 # define NR_PLATFORM NR_PLATFORM_APPLE
00076 #else
00077 # define NR_PLATFORM NR_PLATFORM_LINUX
00078 #endif
00079
00080
00081
00082 #if defined(__x86_64__)
00083 # define NR_ARCH_TYPE NR_ARCHITECTURE_64
00084 #else
00085 # define NR_ARCH_TYPE NR_ARCHITECTURE_32
00086 #endif
00087
00088
00089
00090
00091 #if NR_PLATFORM == NR_PLATFORM_WIN32
00092 #include <windows.h>
00093
00094
00095 #if defined( NONCLIENT_BUILD ) || defined ( BUILDING_DLL ) || defined (BUILD_DLL)
00096 # define _NRExport __declspec( dllexport )
00097 #elif defined (BUILDING_PLUGIN) || defined (BUILD_PLUGIN) || defined (CLIENT_BUILD)
00098 # define _NRExport __declspec( dllimport )
00099 #else
00100 # define _NRExport
00101 #endif
00102
00103
00104 # ifdef _DEBUG
00105 # define NR_DEBUG_MODE 1
00106 # else
00107 # define NR_DEBUG_MODE 0
00108 # endif
00109
00110
00111 #if defined( __MINGW32__ )
00112 #define GCC_3_1
00113 #define EXT_HASH
00114 #else
00115 #define snprintf _snprintf
00116 #define vsnprintf _vsnprintf
00117 #endif
00118
00119 #endif
00120
00121
00122
00123
00124
00125 #if NR_PLATFORM == NR_PLATFORM_LINUX || NR_PLATFORM == NR_PLATFORM_APPLE
00126
00127
00128 # define _NRExport
00129
00130
00131 # define stricmp strcasecmp
00132
00133
00134
00135 # ifdef DEBUG
00136 # define NR_DEBUG_MODE 1
00137 # else
00138 # define NR_DEBUG_MODE 0
00139 # endif
00140
00141 #endif
00142
00143
00144 #if NR_PLATFORM == NR_PLATFORM_APPLE
00145 # include "config.h"
00146
00147
00148
00149
00150
00151
00152 #endif
00153
00154
00155
00156
00157
00158
00159 #ifdef CONFIG_BIG_ENDIAN
00160 # define NR_ENDIAN NR_ENDIAN_BIG
00161 #else
00162 # define NR_ENDIAN NR_ENDIAN_LITTLE
00163 #endif
00164
00165
00166 #endif