Changeset 2639 for code/branches/buildsystem2/src/OrxonoxConfig.h.in
- Timestamp:
- Feb 8, 2009, 12:10:57 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/buildsystem2/src/OrxonoxConfig.h.in
r2619 r2639 21 21 * 22 22 * Author: 23 * Reto Grieder 24 * Co-authors: 23 25 * ... 24 * Co-authors:25 * Reto Grieder26 26 * 27 27 * Original code: OgrePlatform.h, licensed under the LGPL. The code 28 * has changed quite a bit however.28 * has changed almost completely though. 29 29 * 30 30 */ … … 34 34 @brief 35 35 Various constants for compiler, architecture and platform. 36 37 @GENERATED_FILE_COMMENT@ 36 38 */ 37 39 38 #ifndef _Orxonox Platform_H__39 #define _Orxonox Platform_H__40 #ifndef _OrxonoxConfig_H__ 41 #define _OrxonoxConfig_H__ 40 42 41 /* Initial platform/compiler-related stuff to set. */ 43 /*--------------------------------- 44 * Platform and compiler related options 45 *-------------------------------*/ 46 #cmakedefine ORXONOX_PLATFORM_WINDOWS 47 #cmakedefine ORXONOX_PLATFORM_LINUX 48 #cmakedefine ORXONOX_PLATFORM_APPLE 49 #cmakedefine ORXONOX_PLATFORM_UNIX /* Apple and Linux */ 42 50 43 #define ORXONOX_PLATFORM_WIN32 1 44 #define ORXONOX_PLATFORM_LINUX 2 45 #define ORXONOX_PLATFORM_APPLE 3 46 47 #define ORXONOX_COMPILER_MSVC 1 48 #define ORXONOX_COMPILER_GNUC 2 49 #define ORXONOX_COMPILER_BORL 3 50 51 #define ORXONOX_ENDIAN_LITTLE 1 52 #define ORXONOX_ENDIAN_BIG 2 53 54 #define ORXONOX_ARCHITECTURE_32 1 55 #define ORXONOX_ARCHITECTURE_64 2 56 57 58 /* Finds the compiler type and version. */ 59 51 /* Determine compiler and set ORXONOX_COMP_VER */ 60 52 #if defined( _MSC_VER ) 61 # define ORXONOX_COMPILER ORXONOX_COMPILER_MSVC53 # define ORXONOX_COMPILER_MSVC 62 54 # define ORXONOX_COMP_VER _MSC_VER 63 55 64 56 #elif defined( __GNUC__ ) 65 # define ORXONOX_COMPILER ORXONOX_COMPILER_GNUC57 # define ORXONOX_COMPILER_GCC 66 58 # define ORXONOX_COMP_VER (((__GNUC__)*100) + \ 67 59 (__GNUC_MINOR__*10) + \ 68 60 __GNUC_PATCHLEVEL__) 61 # if defined(__MINGW32__) 62 # define ORXONOX_COMPILER_MINGW 63 # endif 69 64 70 65 #elif defined( __BORLANDC__ ) 71 # define ORXONOX_COMPILER ORXONOX_COMPILER_BORL66 # define ORXONOX_COMPILER_BORLAND 72 67 # define ORXONOX_COMP_VER __BCPLUSPLUS__ 73 68 74 69 #else 75 # pragma error "No known compiler. Abort! Abort!"70 # pragma error "No known compiler. Abort!" 76 71 77 72 #endif 78 73 74 /* Endianness */ 75 #cmakedefine ORXONOX_BIG_ENDIAN 76 #cmakedefine ORXONOX_LITTLE_ENDIAN 77 78 /* Architecture */ 79 #cmakedefine ORXONOX_ARCH_32 80 #cmakedefine ORXONOX_ARCH_64 79 81 80 82 /* See if we can use __forceinline or if we need to use __inline instead */ 81 #if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC 82 # if ORXONOX_COMP_VER >= 1200 83 # define FORCEINLINE __forceinline 84 # endif 85 #elif defined(__MINGW32__) 86 # if !defined(FORCEINLINE) 87 # define FORCEINLINE __inline 88 # endif 83 #cmakedefine HAVE_FORCEINLINE 84 #ifdef HAVE_FORCEINLINE 85 # define FORCEINLINE __forceinline 89 86 #else 90 87 # define FORCEINLINE __inline 91 88 #endif 92 89 93 /* Finds the current platform */94 #if defined( __WIN32__ ) || defined( _WIN32 )95 # define ORXONOX_PLATFORM ORXONOX_PLATFORM_WIN3296 #elif defined( __APPLE_CC__)97 # define ORXONOX_PLATFORM ORXONOX_PLATFORM_APPLE98 #else99 # define ORXONOX_PLATFORM ORXONOX_PLATFORM_LINUX100 #endif101 102 /* Find the arch type */103 #if defined(__x86_64__) || defined(_M_X64) || defined(__powerpc64__) || defined(__alpha__) || defined(__ia64__) || defined(__s390__) || defined(__s390x__)104 # define ORXONOX_ARCH_TYPE ORXONOX_ARCHITECTURE_64105 #else106 # define ORXONOX_ARCH_TYPE ORXONOX_ARCHITECTURE_32107 #endif108 109 90 /* Try to define function information */ 110 91 #ifndef __FUNCTIONNAME__ 111 # if ORXONOX_COMPILER == ORXONOX_COMPILER_BORL92 # ifdef ORXONOX_COMPILER_BORLAND 112 93 # define __FUNCTIONNAME__ __FUNC__ 113 # elif ORXONOX_COMPILER == ORXONOX_COMPILER_GNUC94 # elif defined(ORXONOX_COMPILER_GCC) 114 95 # define __FUNCTIONNAME__ __PRETTY_FUNCTION__ 115 # elif ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC96 # elif defined(ORXONOX_COMPILER_MSVC) 116 97 # define __FUNCTIONNAME__ __FUNCTION__ 117 98 # else … … 120 101 #endif 121 102 122 /* Determine whether we're building in debug mode */123 #if defined(_DEBUG) || defined(DEBUG)124 # define ORXONOX_DEBUG_MODE 1125 #else126 # define ORXONOX_DEBUG_MODE 0127 #endif128 103 129 /* Define configurable floating point type */ 130 namespace orxonox 131 { 132 #ifdef ORXONOX_DOUBLE_PRECISION 133 typedef double Real; 134 #else 135 typedef float Real; 136 #endif 137 } 138 139 /* Set whether we must suffix "ceguilua/" for the CEGUILua.h include */ 140 #cmakedefine CEGUILUA_USE_INTERNAL_LIBRARY 141 142 //----------------------------------------------------------------------- 143 // Version Information 144 //----------------------------------------------------------------------- 145 146 #define ORXONOX_VERSION_MAJOR 0 147 #define ORXONOX_VERSION_MINOR 1 148 #define ORXONOX_VERSION_PATCH 2 149 #define ORXONOX_VERSION_SUFFIX "" 150 #define ORXONOX_VERSION_NAME "Bellatrix" 104 /*--------------------------------- 105 * Version information 106 *-------------------------------*/ 107 #define ORXONOX_VERSION_MAJOR @ORXONOX_VERSION_MAJOR@ 108 #define ORXONOX_VERSION_MINOR @ORXONOX_VERSION_MINOR@ 109 #define ORXONOX_VERSION_PATCH @ORXONOX_VERSION_PATCH@ 110 #define ORXONOX_VERSION_NAME "@ORXONOX_VERSION_NAME@" 151 111 152 112 #define ORXONOX_VERSION ((ORXONOX_VERSION_MAJOR << 16) | (ORXONOX_VERSION_MINOR << 8) | ORXONOX_VERSION_PATCH) … … 154 114 155 115 /*--------------------------------- 156 * Windows Settings116 * Unix settings 157 117 *-------------------------------*/ 158 #if ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32 159 /* Disable unicode support on MingW at the moment, poorly supported in stdlibc++ 160 * STLPORT fixes this though so allow if found 161 * MinGW C++ Toolkit supports unicode and sets the define __MINGW32_TOOLKIT_UNICODE__ in _mingw.h */ 162 # if defined( __MINGW32__ ) && !defined(_STLPORT_VERSION) 163 # include<_mingw.h> 164 # if defined(__MINGW32_TOOLBOX_UNICODE__) 165 # define ORXONOX_UNICODE_SUPPORT 1 166 # else 167 # define ORXONOX_UNICODE_SUPPORT 0 168 # endif 169 # else 170 # define ORXONOX_UNICODE_SUPPORT 1 171 # endif 172 #endif /* Platform Win32 */ 173 174 175 /*--------------------------------- 176 * Linux/Apple Settings 177 *-------------------------------*/ 178 #if ORXONOX_PLATFORM == ORXONOX_PLATFORM_LINUX || ORXONOX_PLATFORM == ORXONOX_PLATFORM_APPLE 179 180 /* A quick define to overcome different names for the same function */ 181 # define stricmp strcasecmp 118 #ifdef ORXONOX_PLATFORM_UNIX 182 119 183 120 /* TODO: Check what this actually is and whether we need it or not */ 184 121 #if 0 185 # if ORXONOX_PLATFORM ==ORXONOX_PLATFORM_APPLE122 # ifdef ORXONOX_PLATFORM_APPLE 186 123 # define ORXONOX_PLATFORM_LIB "OrxonoxPlatform.bundle" 187 124 # else … … 191 128 #endif 192 129 193 /* Always enable unicode support for the moment 194 * Perhaps disable in old versions of gcc if necessary */ 195 # define ORXONOX_UNICODE_SUPPORT 1 196 197 #endif /* Patform Linux/Apple */ 130 #endif /* Patform Unix */ 198 131 199 132 … … 201 134 * Apple Settings 202 135 *-------------------------------*/ 203 /* For apple, we always have a custom config.h file */204 #if ORXONOX_PLATFORM == ORXONOX_PLATFORM_APPLE205 # include "config.h"206 #endif207 136 208 137 209 138 /*--------------------------------- 210 * Visual Studio Settings139 * Includes 211 140 *-------------------------------*/ 212 #if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC 213 /* Turn off warnings generated by long std templates 214 * This warns about truncation to 255 characters in debug/browse info */ 215 /*# pragma warning (disable : 4786)*/ 141 /* Set whether we must suffix "ceguilua/" for the CEGUILua.h include */ 142 #cmakedefine CEGUILUA_USE_INTERNAL_LIBRARY 216 143 217 /* Turn off warnings generated by long std templates 218 * This warns about truncation to 255 characters in debug/browse info */ 219 /*# pragma warning (disable : 4503)*/ 144 /* Define the english written operators like and, or, xor 145 * This is C++ standard, but the Microsoft compiler doesn't define them. */ 146 #cmakedefine HAVE_CISO646 147 #ifdef HAVE_CISO646 148 # include <ciso646> 149 #endif 220 150 221 /* disable: conversion from 'double' to 'float', possible loss of data 222 * disable: conversion from 'ogg_int64_t' to 'long', possible loss of data 223 * This has been dealt with in base_properties of the solution since the 224 * warning primarily occurs in library header files (which are mostly 225 * included before OrxonoxPlatform.h is) */ 226 /*# pragma warning (disable : 4244)*/ 151 #cmakedefine HAVE_CSTDINT 152 #ifdef HAVE_CSTDINT 153 # include <cstdint> 154 #elif defined(ORXONOX_COMPILER_MSVC) 155 typedef __int8 int8_t; 156 typedef __int16 int16_t; 157 typedef __int32 int32_t; 158 typedef __int64 int64_t; 159 typedef unsigned __int8 uint8_t; 160 typedef unsigned __int16 uint16_t; 161 typedef unsigned __int32 uint32_t; 162 typedef unsigned __int64 uint64_t; 163 #endif 227 164 228 /* disable: "conversion from 'size_t' to 'unsigned int', possible loss of data */ 229 /*# pragma warning (disable : 4267)*/ 165 #cmakedefine HAVE_CSTDDEF 166 #ifdef HAVE_CSTDDEF 167 # include <cstddef> 168 #endif 230 169 231 /* disable: "truncation from 'double' to 'float' */ 232 /*# pragma warning (disable : 4305)*/ 170 /* Visual Leak Detector looks for memory leaks */ 171 #cmakedefine ACTIVATE_VISUAL_LEAK_DETECTOR 172 #ifdef ACTIVATE_VISUAL_LEAK_DETECTOR 173 # include <vld.h> 174 #endif 233 175 234 /* set to level 4: "<type> needs to have dll-interface to be used by clients' 235 * Happens on STL member variables which are not public therefore is ok */ 236 # pragma warning (disable : 4251) 237 238 /* disable: 'MultiTypeString' : multiple assignment operators specified 239 * Used in MultiType and works fine so far */ 240 /*# pragma warning (disable : 4522)*/ 241 242 /* disable: "non dll-interface class used as base for dll-interface class" 243 * Happens when deriving from Singleton because bug in compiler ignores 244 * template export */ 245 /*# pragma warning (disable : 4275)*/ 246 247 /* disable: "C++ Exception Specification ignored" 248 * This is because MSVC 6 did not implement all the C++ exception 249 * specifications in the ANSI C++ draft. */ 250 /*# pragma warning( disable : 4290 )*/ 251 252 /* disable: "no suitable definition provided for explicit template 253 * instantiation request" Occurs in VC7 for no justifiable reason on all 254 * #includes of Singleton */ 255 /*# pragma warning( disable: 4661)*/ 256 257 /* disable: deprecation warnings when using CRT calls in VC8 258 * These show up on all C runtime lib code in VC8, disable since they clutter 259 * the warnings with things we may not be able to do anything about (e.g. 260 * generated code from nvparse etc). I doubt very much that these calls 261 * will ever be actually removed from VC anyway, it would break too much code. */ 262 /*# pragma warning( disable: 4996)*/ 263 264 /* disable: "conditional expression constant", always occurs on 265 * ORXONOX_MUTEX_CONDITIONAL when no threading enabled */ 266 /*# pragma warning (disable : 201)*/ 267 268 269 /* Define the english written operators like and, or, xor */ 270 #include <iso646.h> 271 272 /* include visual leak detector to search for memory leaks */ 273 /* #include <vld.h> */ 274 275 #endif /* ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC */ 276 277 #endif /* _OrxonoxPlatform_H__ */ 176 #endif /* _OrxonoxConfig_H__ */
Note: See TracChangeset
for help on using the changeset viewer.