Go to the documentation of this file.00001
00002
00003 #ifndef _ENGINE_CONFIG_H_
00004 #define _ENGINE_CONFIG_H_
00005
00007
00008 #define PLATFORM_WIN32 1
00009 #define PLATFORM_LINUX 2
00010 #define PLATFORM_APPLE 3
00011
00012 #define COMPILER_MSVC 1
00013 #define COMPILER_GNUC 2
00014 #define COMPILER_BORL 3
00015
00016 #define COMPILER_DEBUG 1
00017 #define COMPILER_RELEASE 2
00018
00019 #define ARCHITECTURE_32 1
00020 #define ARCHITECTURE_64 2
00021
00022 #define ENDIAN_LITTLE 1
00023 #define ENDIAN_BIG 2
00024
00025
00027
00029
00030
00032 #define KG_VERSION "0.3.0"
00033
00034 #define ENGINE_UNIT 100
00035
00037
00039
00040 #if defined(__APPLE__)
00041 # define ENGINE_PLATFORM PLATFORM_APPLE
00042
00043 #elif defined(WIN32) || defined(WIN64) || defined(__WIN32__) || defined(_WIN32)
00044 # define ENGINE_PLATFORM PLATFORM_WIN32
00045
00046 #elif !defined(WIN32) && !defined(_XBOX) && !defined(OS2) && !defined(MACOSX)
00047 # define ENGINE_PLATFORM PLATFORM_LINUX
00048
00049 #else
00050 # pragma error "No known OS. Abort! Abort!"
00051
00052 #endif
00053
00055
00057
00058 #if defined(_MSC_VER)
00059 # define ENGINE_COMPILER COMPILER_MSVC
00060 # define ENGINE_COMPILER_VERSION _MSC_VER
00061
00062 #elif defined(__GNUC__)
00063 # define ENGINE_COMPILER COMPILER_GNUC
00064 # define ENGINE_COMPILER_VERSION (((__GNUC__)*100) + (__GNUC_MINOR__*10) + __GNUC_PATCHLEVEL__)
00065
00066 #elif defined(__BORLANDC__)
00067 # define ENGINE_COMPILER COMPILER_BORL
00068 # define ENGINE_COMPILER_VERSION __BCPLUSPLUS__
00069
00070 #else
00071 # pragma error "No known compiler. Abort! Abort!"
00072
00073 #endif
00074
00075 #if ENGINE_PLATFORM == PLATFORM_WIN32
00076
00077 # ifdef _DEBUG
00078 # define ENGINE_COMPILER_MODE COMPILER_DEBUG
00079 # else
00080 # define ENGINE_COMPILER_MODE COMPILER_RELEASE
00081 # endif
00082 #elif ENGINE_PLATFORM == PLATFORM_LINUX || ENGINE_PLATFORM == PLATFORM_APPLE
00083
00084
00085
00086
00087 # ifdef DEBUG
00088 # define ENGINE_COMPILER_MODE COMPILER_DEBUG
00089 # else
00090 # define ENGINE_COMPILER_MODE COMPILER_RELEASE
00091 # endif
00092 #endif
00093
00094
00096
00098
00099 #if defined(__x86_64__) || defined(_M_X64) || defined(__powerpc64__) || defined(__alpha__) || defined(__ia64__) || defined(__s390__) || defined(__s390x__)
00100 # define ENGINE_ARCHITECTURE_TYPE ARCHITECTURE_64
00101 #else
00102 # define ENGINE_ARCHITECTURE_TYPE ARCHITECTURE_32
00103 #endif
00104
00105 #if defined(__sparc__) || defined(__sun__)
00106 # define ENGINE_ARCHITECTURE_ENDIAN ENDIAN_BIG
00107 #else
00108 # define ENGINE_ARCHITECTURE_ENDIAN ENDIAN_LITTLE
00109 #endif
00110
00112
00114
00115 #if ENGINE_PLATFORM == PLATFORM_WIN32
00116
00117
00118
00119 # if defined( __MINGW32__ ) && !defined(_STLPORT_VERSION)
00120 # include<_mingw.h>
00121 # if defined(__MINGW32_TOOLBOX_UNICODE__)
00122 # define ENGINE_UNICODE_SUPPORT 1
00123 # else
00124 # define ENGINE_UNICODE_SUPPORT 0
00125 # endif
00126 # else
00127 # define ENGINE_UNICODE_SUPPORT 1
00128 # endif
00129
00130 #elif ENGINE_PLATFORM == PLATFORM_LINUX || ENGINE_PLATFORM == PLATFORM_APPLE
00131
00132
00133 # define ENGINE_UNICODE_SUPPORT 1
00134
00135 #endif
00136
00138
00140
00141 #if ENGINE_PLATFORM == PLATFORM_WIN32
00142
00143
00144 # if defined(MINGW) || defined(__MINGW32__)
00145
00146 # define ENGINE_PUBLIC_EXPORT
00147 # define ENGINE_TEMPLATE_EXPORT
00148 # define ENGINE_PRIVATE_EXPORT
00149 # else
00150 # ifdef GAME_ENGINE_DLL
00151 # define ENGINE_PUBLIC_EXPORT __declspec(dllexport)
00152 # define ENGINE_TEMPLATE_EXPORT __declspec(dllexport)
00153 # else
00154 # define ENGINE_PUBLIC_EXPORT __declspec(dllimport)
00155 # define ENGINE_TEMPLATE_EXPORT
00156 # endif
00157 # define ENGINE_PRIVATE_EXPORT
00158 # endif
00159 #elif ENGINE_PLATFORM == PLATFORM_LINUX || ENGINE_PLATFORM == PLATFORM_APPLE
00160
00161 # if ENGINE_COMPILER_VERSION >= 400
00162 # define ENGINE_PUBLIC_EXPORT __attribute__ ((visibility("default")))
00163 # define ENGINE_TEMPLATE_EXPORT __attribute__ ((visibility("default")))
00164 # define ENGINE_PRIVATE_EXPORT __attribute__ ((visibility("hidden")))
00165 # else
00166 # define ENGINE_PUBLIC_EXPORT
00167 # define ENGINE_TEMPLATE_EXPORT
00168 # define ENGINE_PRIVATE_EXPORT
00169 # endif
00170 #else
00171 # define ENGINE_PUBLIC_EXPORT
00172 # define ENGINE_TEMPLATE_EXPORT
00173 # define ENGINE_PRIVATE_EXPORT
00174 #endif
00175
00177
00178 #if ENGINE_PLATFORM == PLATFORM_WIN32
00179 # if ENGINE_COMPILER == COMPILER_MSVC
00180 # define ENGINE_CALLBACK __stdcall
00181 # define ENGINE_CALLCONV __cdecl
00182 # else
00183 # define ENGINE_CALLBACK
00184 # define ENGINE_CALLCONV
00185 # endif
00186 #elif ENGINE_PLATFORM == PLATFORM_LINUX || ENGINE_PLATFORM == PLATFORM_APPLE
00187 # define ENGINE_CALLBACK
00188 # define ENGINE_CALLCONV
00189 #else
00190 # define ENGINE_CALLBACK
00191 # define ENGINE_CALLCONV
00192 #endif
00193
00194 #if ENGINE_PLATFORM == PLATFORM_WIN32
00195 # if ENGINE_COMPILER == COMPILER_MSVC
00196 # define snprintf _snprintf
00197 # if !defined(_CRT_SECURE_NO_DEPRECATE)
00198 # define _CRT_SECURE_NO_DEPRECATE
00199 # endif
00200 # endif
00201 #endif
00202
00203 #if (ENGINE_COMPILER == COMPILER_GNUC) && !defined(STLPORT)
00204 # if ENGINE_COMPILER_VERSION >= 430
00205 # include <tr1/unordered_map>
00206 # include <tr1/unordered_set>
00207 # else
00208 # include <ext/hash_map>
00209 # include <ext/hash_set>
00210 # endif
00211 #else
00212 # if (ENGINE_COMPILER == COMPILER_MSVC) && !defined(STLPORT) && ENGINE_COMPILER_VERSION >= 1600 // VC++ 10.0
00213 # include <unordered_map>
00214 # include <unordered_set>
00215 # else
00216 # include <hash_set>
00217 # include <hash_map>
00218 # endif
00219 #endif
00220
00221 #if ENGINE_PLATFORM == COMPILER_GNUC && ENGINE_COMPILER_VERSION >= 310 && !defined(STLPORT)
00222 # if ENGINE_COMPILER_VERSION >= 430
00223 # define hashmap ::std::tr1::unordered_map
00224 # define hashset ::std::tr1::unordered_set
00225 # else
00226 # define hashmap ::__gnu_cxx::hash_map
00227 # define hashset ::__gnu_cxx::hash_set
00228 # endif
00229 #else
00230 # if ENGINE_COMPILER == COMPILER_MSVC
00231 # if ENGINE_COMPILER_VERSION >= 1600 // VC++ 10.0
00232 # define hashmap ::std::tr1::unordered_map
00233 # define hashset ::std::tr1::unordered_set
00234 # elif ENGINE_COMPILER_VERSION > 1300 && !defined(_STLP_MSVC)
00235 # define hashmap ::stdext::hash_map
00236 # define hashset ::stdext::hash_set
00237 # else
00238 # define hashmap ::std::hash_map
00239 # define hashset ::std::hash_set
00240 # endif
00241 # else
00242 # define hashmap ::std::hash_map
00243 # define hashset ::std::hash_set
00244 # endif
00245 #endif
00246
00248
00249 #if ENGINE_COMPILER == COMPILER_MSVC
00250
00251
00252 # pragma warning (disable : 4786)
00253
00254
00255
00256 # pragma warning (disable : 4503)
00257
00258
00259
00260 # pragma warning (disable : 4251)
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290 #endif
00291
00293
00295
00296
00297
00298 #if defined(_DEBUG) && defined(ENGINE_MEMORY_TRACKER)
00299 #include "crtdbg.h"
00300 #define ENGINE_CLIENTBLOCK new(_CLIENT_BLOCK, __FILE__, __LINE__)
00301 #else
00302 #define ENGINE_CLIENTBLOCK
00303 #endif // _DEBUG
00304
00305
00307
00308 #include <wchar.h>
00309 #include <assert.h>
00310
00311 #ifdef _DEBUG
00312 # include <iostream>
00313 #endif
00314
00315 #endif // _CONFIG_H_