/* * 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 #cmakedefine ORXONOX_ARCH_32 #cmakedefine ORXONOX_ARCH_64 // See if we can use __forceinline or if we need to use __inline instead #cmakedefine HAVE_FORCEINLINE #ifndef FORCEINLINE # ifdef HAVE_FORCEINLINE # define FORCEINLINE __forceinline # else # define 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 /*--------------------------------- * 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 *-------------------------------*/ /*--------------------------------- * Options *-------------------------------*/ #cmakedefine ORXONOX_RELEASE ///< Enables expensive (build time) optimisations and disables certain features /*--------------------------------- * 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 #cmakedefine HAVE_STDINT_H #ifdef 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 */ // Include memory leak detector if available and not building actual release #cmakedefine HAVE_VLD #if defined(HAVE_VLD) && !defined(ORXONOX_RELEASE) typedef uint32_t UINT32; typedef wchar_t WCHAR; struct HINSTANCE__; typedef struct HINSTANCE__* HINSTANCE; typedef HINSTANCE HMODULE; # ifndef NULL # define NULL 0 # endif # include #endif // Forward declare the everywhere used std::string namespace std { template struct char_traits; template class allocator; template class basic_string; typedef basic_string, allocator > string; } // Import general purpose smart pointers namespace boost { template class scoped_ptr; template class shared_ptr; template class weak_ptr; template class intrusive_ptr; template class shared_array; template class scoped_array; } namespace orxonox { using boost::scoped_ptr; using boost::shared_ptr; using boost::weak_ptr; using boost::intrusive_ptr; using boost::shared_array; using boost::scoped_array; } #endif /* _OrxonoxConfig_H__ */