[682] | 1 | /* |
---|
| 2 | * ORXONOX - the hottest 3D action shooter ever to exist |
---|
[1505] | 3 | * > www.orxonox.net < |
---|
[682] | 4 | * |
---|
| 5 | * |
---|
| 6 | * License notice: |
---|
| 7 | * |
---|
| 8 | * This program is free software; you can redistribute it and/or |
---|
| 9 | * modify it under the terms of the GNU General Public License |
---|
| 10 | * as published by the Free Software Foundation; either version 2 |
---|
| 11 | * of the License, or (at your option) any later version. |
---|
| 12 | * |
---|
| 13 | * This program is distributed in the hope that it will be useful, |
---|
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 16 | * GNU General Public License for more details. |
---|
| 17 | * |
---|
| 18 | * You should have received a copy of the GNU General Public License |
---|
| 19 | * along with this program; if not, write to the Free Software |
---|
| 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
| 21 | * |
---|
| 22 | * Author: |
---|
[2639] | 23 | * Reto Grieder |
---|
| 24 | * Co-authors: |
---|
[1293] | 25 | * ... |
---|
[682] | 26 | * |
---|
[1755] | 27 | * Original code: OgrePlatform.h, licensed under the LGPL. The code |
---|
[2639] | 28 | * has changed almost completely though. |
---|
[1755] | 29 | * |
---|
[2643] | 30 | * Caution: Do not configure this file CMake configuration (Debug, Release, etc.) |
---|
| 31 | * dependent! XCode and Visual Studio have the same file for all. |
---|
| 32 | * |
---|
[682] | 33 | */ |
---|
[1505] | 34 | |
---|
[682] | 35 | /** |
---|
[3196] | 36 | @file |
---|
| 37 | @brief |
---|
[1755] | 38 | Various constants for compiler, architecture and platform. |
---|
[3196] | 39 | @remarks |
---|
[2639] | 40 | @GENERATED_FILE_COMMENT@ |
---|
[3196] | 41 | */ |
---|
[1505] | 42 | |
---|
[2639] | 43 | #ifndef _OrxonoxConfig_H__ |
---|
| 44 | #define _OrxonoxConfig_H__ |
---|
[1505] | 45 | |
---|
[2639] | 46 | /*--------------------------------- |
---|
| 47 | * Platform and compiler related options |
---|
| 48 | *-------------------------------*/ |
---|
| 49 | #cmakedefine ORXONOX_PLATFORM_WINDOWS |
---|
| 50 | #cmakedefine ORXONOX_PLATFORM_LINUX |
---|
| 51 | #cmakedefine ORXONOX_PLATFORM_APPLE |
---|
| 52 | #cmakedefine ORXONOX_PLATFORM_UNIX /* Apple and Linux */ |
---|
[1755] | 53 | |
---|
[3196] | 54 | // Determine compiler and set ORXONOX_COMP_VER |
---|
[1505] | 55 | #if defined( _MSC_VER ) |
---|
[2639] | 56 | # define ORXONOX_COMPILER_MSVC |
---|
[1505] | 57 | # define ORXONOX_COMP_VER _MSC_VER |
---|
| 58 | |
---|
| 59 | #elif defined( __GNUC__ ) |
---|
[2639] | 60 | # define ORXONOX_COMPILER_GCC |
---|
[1505] | 61 | # define ORXONOX_COMP_VER (((__GNUC__)*100) + \ |
---|
| 62 | (__GNUC_MINOR__*10) + \ |
---|
| 63 | __GNUC_PATCHLEVEL__) |
---|
[2639] | 64 | # if defined(__MINGW32__) |
---|
| 65 | # define ORXONOX_COMPILER_MINGW |
---|
| 66 | # endif |
---|
[1505] | 67 | |
---|
| 68 | #elif defined( __BORLANDC__ ) |
---|
[2639] | 69 | # define ORXONOX_COMPILER_BORLAND |
---|
[1505] | 70 | # define ORXONOX_COMP_VER __BCPLUSPLUS__ |
---|
| 71 | |
---|
| 72 | #else |
---|
[2639] | 73 | # pragma error "No known compiler. Abort!" |
---|
[1505] | 74 | |
---|
| 75 | #endif |
---|
| 76 | |
---|
[3196] | 77 | // Endianness |
---|
[2639] | 78 | #cmakedefine ORXONOX_BIG_ENDIAN |
---|
| 79 | #cmakedefine ORXONOX_LITTLE_ENDIAN |
---|
[1755] | 80 | |
---|
[3196] | 81 | // Architecture |
---|
[2639] | 82 | #cmakedefine ORXONOX_ARCH_32 |
---|
| 83 | #cmakedefine ORXONOX_ARCH_64 |
---|
| 84 | |
---|
[3196] | 85 | // See if we can use __forceinline or if we need to use __inline instead |
---|
[2639] | 86 | #cmakedefine HAVE_FORCEINLINE |
---|
[2797] | 87 | #ifndef FORCEINLINE |
---|
| 88 | # ifdef HAVE_FORCEINLINE |
---|
| 89 | # define FORCEINLINE __forceinline |
---|
| 90 | # else |
---|
| 91 | # define FORCEINLINE __inline |
---|
| 92 | # endif |
---|
[1505] | 93 | #endif |
---|
| 94 | |
---|
[3196] | 95 | // Try to define function information |
---|
[1755] | 96 | #ifndef __FUNCTIONNAME__ |
---|
[2639] | 97 | # ifdef ORXONOX_COMPILER_BORLAND |
---|
[1755] | 98 | # define __FUNCTIONNAME__ __FUNC__ |
---|
[2639] | 99 | # elif defined(ORXONOX_COMPILER_GCC) |
---|
[1755] | 100 | # define __FUNCTIONNAME__ __PRETTY_FUNCTION__ |
---|
[2639] | 101 | # elif defined(ORXONOX_COMPILER_MSVC) |
---|
[1755] | 102 | # define __FUNCTIONNAME__ __FUNCTION__ |
---|
[1505] | 103 | # else |
---|
[1755] | 104 | # define __FUNCTIONNAME__ |
---|
[1505] | 105 | # endif |
---|
[1755] | 106 | #endif |
---|
[1505] | 107 | |
---|
[1755] | 108 | |
---|
[2639] | 109 | /*--------------------------------- |
---|
| 110 | * Version information |
---|
| 111 | *-------------------------------*/ |
---|
| 112 | #define ORXONOX_VERSION_MAJOR @ORXONOX_VERSION_MAJOR@ |
---|
| 113 | #define ORXONOX_VERSION_MINOR @ORXONOX_VERSION_MINOR@ |
---|
| 114 | #define ORXONOX_VERSION_PATCH @ORXONOX_VERSION_PATCH@ |
---|
| 115 | #define ORXONOX_VERSION_NAME "@ORXONOX_VERSION_NAME@" |
---|
[1755] | 116 | |
---|
[3196] | 117 | //! Defines version info encoded as 0xMMIIPP (M: Major version, I: Minor version, P: Patch version, all as hex) |
---|
| 118 | #define ORXONOX_VERSION \ |
---|
| 119 | ((ORXONOX_VERSION_MAJOR << 16) | (ORXONOX_VERSION_MINOR << 8) | ORXONOX_VERSION_PATCH) |
---|
[1921] | 120 | |
---|
| 121 | |
---|
[1755] | 122 | /*--------------------------------- |
---|
[2639] | 123 | * Unix settings |
---|
[1755] | 124 | *-------------------------------*/ |
---|
[2639] | 125 | #ifdef ORXONOX_PLATFORM_UNIX |
---|
[1505] | 126 | |
---|
[3196] | 127 | // TODO: Check what this actually is and whether we need it or not |
---|
[1755] | 128 | #if 0 |
---|
[2639] | 129 | # ifdef ORXONOX_PLATFORM_APPLE |
---|
[1505] | 130 | # define ORXONOX_PLATFORM_LIB "OrxonoxPlatform.bundle" |
---|
[3196] | 131 | # else // ORXONOX_PLATFORM_LINUX |
---|
[1505] | 132 | # define ORXONOX_PLATFORM_LIB "libOrxonoxPlatform.so" |
---|
| 133 | # endif |
---|
[1755] | 134 | #endif |
---|
[1505] | 135 | |
---|
[2639] | 136 | #endif /* Patform Unix */ |
---|
[1505] | 137 | |
---|
| 138 | |
---|
[1755] | 139 | /*--------------------------------- |
---|
| 140 | * Apple Settings |
---|
| 141 | *-------------------------------*/ |
---|
[1505] | 142 | |
---|
| 143 | |
---|
[1755] | 144 | /*--------------------------------- |
---|
[3196] | 145 | * Options |
---|
[2946] | 146 | *-------------------------------*/ |
---|
[3196] | 147 | /** |
---|
| 148 | @def ORXONOX_RELEASE |
---|
| 149 | Enables expensive (build time) optimisations and disables certain features |
---|
| 150 | */ |
---|
| 151 | #cmakedefine ORXONOX_RELEASE |
---|
[2946] | 152 | |
---|
| 153 | |
---|
| 154 | /*--------------------------------- |
---|
[3196] | 155 | * Includes and Declarations |
---|
[1755] | 156 | *-------------------------------*/ |
---|
[3196] | 157 | // Define the english written operators like and, or, xor |
---|
| 158 | // This is C++ standard, but the Microsoft compiler doesn't define them. |
---|
[2650] | 159 | #cmakedefine HAVE_ISO646_H |
---|
| 160 | #ifdef HAVE_ISO646_H |
---|
| 161 | # include <iso646.h> |
---|
[2639] | 162 | #endif |
---|
[1505] | 163 | |
---|
[2650] | 164 | #cmakedefine HAVE_STDINT_H |
---|
| 165 | #ifdef HAVE_STDINT_H |
---|
| 166 | # include <stdint.h> |
---|
[2639] | 167 | #elif defined(ORXONOX_COMPILER_MSVC) |
---|
| 168 | typedef __int8 int8_t; |
---|
| 169 | typedef __int16 int16_t; |
---|
| 170 | typedef __int32 int32_t; |
---|
| 171 | typedef __int64 int64_t; |
---|
| 172 | typedef unsigned __int8 uint8_t; |
---|
| 173 | typedef unsigned __int16 uint16_t; |
---|
| 174 | typedef unsigned __int32 uint32_t; |
---|
| 175 | typedef unsigned __int64 uint64_t; |
---|
| 176 | #endif |
---|
[1505] | 177 | |
---|
[2650] | 178 | #cmakedefine HAVE_STDDEF_H |
---|
[2685] | 179 | /* Quite large, do not include unless necessary |
---|
[2650] | 180 | #ifdef HAVE_STDDEF_H |
---|
| 181 | # include <stddef.h> |
---|
[2639] | 182 | #endif |
---|
[2685] | 183 | */ |
---|
[1505] | 184 | |
---|
[3196] | 185 | // Always include the memory leak detector for MSVC except for actual releases |
---|
| 186 | // Note: Although officially supported, VLD does not work with MSVC 9 |
---|
| 187 | #if defined(ORXONOX_COMPILER_MSVC) && _MSC_VER < 1500 && !defined(ORXONOX_RELEASE) |
---|
[2639] | 188 | # include <vld.h> |
---|
| 189 | #endif |
---|
[1505] | 190 | |
---|
[3196] | 191 | // Forward declare the everywhere used std::string |
---|
| 192 | namespace std |
---|
| 193 | { |
---|
| 194 | template<class _Elem> struct char_traits; |
---|
| 195 | template<class _Ty> class allocator; |
---|
| 196 | template<class _Elem, class _Traits, class _Ax> class basic_string; |
---|
| 197 | typedef basic_string<char, char_traits<char>, allocator<char> > string; |
---|
| 198 | } |
---|
| 199 | |
---|
[5695] | 200 | // Import general purpose smart pointers |
---|
| 201 | namespace boost |
---|
| 202 | { |
---|
| 203 | template<class T> class scoped_ptr; |
---|
| 204 | template<class T> class shared_ptr; |
---|
| 205 | template<class T> class weak_ptr; |
---|
| 206 | template<class T> class intrusive_ptr; |
---|
| 207 | template<class T> class shared_array; |
---|
| 208 | template<class T> class scoped_array; |
---|
| 209 | } |
---|
| 210 | namespace orxonox |
---|
| 211 | { |
---|
| 212 | using boost::scoped_ptr; |
---|
| 213 | using boost::shared_ptr; |
---|
| 214 | using boost::weak_ptr; |
---|
| 215 | using boost::intrusive_ptr; |
---|
| 216 | using boost::shared_array; |
---|
| 217 | using boost::scoped_array; |
---|
| 218 | } |
---|
| 219 | |
---|
[2639] | 220 | #endif /* _OrxonoxConfig_H__ */ |
---|