/* * ORXONOX - the hottest 3D action shooter ever to exist * > www.orxonox.net < * * * License notice: * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * Author: * Reto Grieder * Co-authors: * ... * * Original code: OgrePlatform.h, licensed under the LGPL. The code * has changed almost completely though. * * Caution: Do not configure this file CMake configuration (Debug, Release, etc.) * dependent! XCode and Visual Studio have the same file for all. * */ /** @file @brief Various constants for compiler, architecture and platform. @remarks @GENERATED_FILE_COMMENT@ */ #ifndef _OrxonoxConfig_H__ #define _OrxonoxConfig_H__ /*--------------------------------- * Platform and compiler related options *-------------------------------*/ #cmakedefine ORXONOX_PLATFORM_WINDOWS #cmakedefine ORXONOX_PLATFORM_LINUX #cmakedefine ORXONOX_PLATFORM_APPLE #cmakedefine ORXONOX_PLATFORM_UNIX /* Apple and Linux */ // Determine compiler and set ORXONOX_COMP_VER #if defined( _MSC_VER ) # define ORXONOX_COMPILER_MSVC # define ORXONOX_COMP_VER _MSC_VER #elif defined( __GNUC__ ) # define ORXONOX_COMPILER_GCC # define ORXONOX_COMP_VER (((__GNUC__)*100) + \ (__GNUC_MINOR__*10) + \ __GNUC_PATCHLEVEL__) # if defined(__MINGW32__) # define ORXONOX_COMPILER_MINGW # endif #elif defined( __BORLANDC__ ) # define ORXONOX_COMPILER_BORLAND # define ORXONOX_COMP_VER __BCPLUSPLUS__ #else # pragma error "No known compiler. Abort!" #endif // Endianness #cmakedefine ORXONOX_BIG_ENDIAN #cmakedefine ORXONOX_LITTLE_ENDIAN // Architecture #if defined(__x86_64__) || defined(_M_X64) || defined(__powerpc64__) || defined(__alpha__) || defined(__ia64__) || defined(__s390__) || defined(__s390x__) # define ORXONOX_ARCH_64 #else # define ORXONOX_ARCH_32 #endif // See if we can use __forceinline or if we need to use __inline instead #cmakedefine HAVE_FORCEINLINE #ifndef ORX_FORCEINLINE # ifdef HAVE_FORCEINLINE # define ORX_FORCEINLINE __forceinline # else # define ORX_FORCEINLINE __inline # endif #endif // Try to define function information #ifndef __FUNCTIONNAME__ # ifdef ORXONOX_COMPILER_BORLAND # define __FUNCTIONNAME__ __FUNC__ # elif defined(ORXONOX_COMPILER_GCC) # define __FUNCTIONNAME__ __PRETTY_FUNCTION__ # elif defined(ORXONOX_COMPILER_MSVC) # define __FUNCTIONNAME__ __FUNCTION__ # else # define __FUNCTIONNAME__ # endif #endif // Declare a function deprecated #ifndef __DEPRECATED__ # if defined(ORXONOX_COMPILER_GCC) # define __DEPRECATED__(function) function __attribute__ ((deprecated)) # elif defined(ORXONOX_COMPILER_MSVC) # define __DEPRECATED__(function) __declspec(deprecated) function # else # define __DEPRECATED__(function) function # endif #endif #ifndef __UNIQUE_NUMBER__ # if defined(ORXONOX_COMPILER_GCC) && ORXONOX_COMP_VER >= 430 # define __UNIQUE_NUMBER__ __COUNTER__ # elif defined(ORXONOX_COMPILER_MSVC) # define __UNIQUE_NUMBER__ __COUNTER__ # else # define __UNIQUE_NUMBER__ __LINE__ # endif #endif /*--------------------------------- * Version information *-------------------------------*/ #define ORXONOX_VERSION_MAJOR @ORXONOX_VERSION_MAJOR@ #define ORXONOX_VERSION_MINOR @ORXONOX_VERSION_MINOR@ #define ORXONOX_VERSION_PATCH @ORXONOX_VERSION_PATCH@ #define ORXONOX_VERSION_NAME "@ORXONOX_VERSION_NAME@" //! Defines version info encoded as 0xMMIIPP (M: Major version, I: Minor version, P: Patch version, all as hex) #define ORXONOX_VERSION \ ((ORXONOX_VERSION_MAJOR << 16) | (ORXONOX_VERSION_MINOR << 8) | ORXONOX_VERSION_PATCH) /*--------------------------------- * Unix settings *-------------------------------*/ #ifdef ORXONOX_PLATFORM_UNIX // TODO: Check what this actually is and whether we need it or not #if 0 # ifdef ORXONOX_PLATFORM_APPLE # define ORXONOX_PLATFORM_LIB "OrxonoxPlatform.bundle" # else // ORXONOX_PLATFORM_LINUX # define ORXONOX_PLATFORM_LIB "libOrxonoxPlatform.so" # endif #endif #endif /* Patform Unix */ /*--------------------------------- * Apple Settings *-------------------------------*/ /*--------------------------------- * Includes and Declarations *-------------------------------*/ // Define the english written operators like and, or, xor // This is C++ standard, but the Microsoft compiler doesn't define them. #cmakedefine HAVE_ISO646_H #ifdef HAVE_ISO646_H # include #endif // On OS X some headers already define HAVE_STDINT_H and that spits out // some warnings. Therefore we use this macro. // Note: This requires some extra code in OrxonoxConfig.cmake #cmakedefine ORX_HAVE_STDINT_H #ifdef ORX_HAVE_STDINT_H # include #elif defined(ORXONOX_COMPILER_MSVC) typedef __int8 int8_t; typedef __int16 int16_t; typedef __int32 int32_t; typedef __int64 int64_t; typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; typedef unsigned __int64 uint64_t; #endif #cmakedefine HAVE_STDDEF_H /* Quite large, do not include unless necessary #ifdef HAVE_STDDEF_H # include #endif */ // Configurations Release, RelWithDebInfo and MinSizeRel are designed for // redistribution while RelForDevs is for development purposes // ORXONOX_RELEASE simplifies this a little bit #if defined(CMAKE_Release_BUILD) || defined(CMAKE_MinSizeRel_BUILD) \ || defined(CMAKE_RelWithDebInfo_BUILD) # define ORXONOX_RELEASE #endif // Define Boost Filesystem version #include #ifndef BOOST_FILESYSTEM_VERSION # if (BOOST_VERSION < 104600) # define BOOST_FILESYSTEM_VERSION 2 # else # define BOOST_FILESYSTEM_VERSION 3 # endif #endif // CEGUI changed its file naming convention in version 0.8 thus we cannot even include CEGUI's Version.h file before knowing its version #include <@CEGUI_VERSION_FILE@> #define CEGUI_VERSION ((CEGUI_VERSION_MAJOR << 16) | (CEGUI_VERSION_MINOR << 8) | CEGUI_VERSION_PATCH) #endif /* _OrxonoxConfig_H__ */