00001 /* 00002 ----------------------------------------------------------------------------- 00003 This source file is part of OGRE 00004 (Object-oriented Graphics Rendering Engine) 00005 For the latest info, see http://www.ogre3d.org/ 00006 00007 Copyright (c) 2000-2005 The OGRE Team 00008 Also see acknowledgements in Readme.html 00009 00010 This program is free software; you can redistribute it and/or modify it under 00011 the terms of the GNU Lesser General Public License as published by the Free Software 00012 Foundation; either version 2 of the License, or (at your option) any later 00013 version. 00014 00015 This program is distributed in the hope that it will be useful, but WITHOUT 00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 00018 00019 You should have received a copy of the GNU Lesser General Public License along with 00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple 00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to 00022 http://www.gnu.org/copyleft/lesser.txt. 00023 ----------------------------------------------------------------------------- 00024 */ 00025 #ifndef __Platform_H_ 00026 #define __Platform_H_ 00027 00028 #include "OgreConfig.h" 00029 00030 namespace Ogre { 00031 /* Initial platform/compiler-related stuff to set. 00032 */ 00033 #define OGRE_PLATFORM_WIN32 1 00034 #define OGRE_PLATFORM_LINUX 2 00035 #define OGRE_PLATFORM_APPLE 3 00036 00037 #define OGRE_COMPILER_MSVC 1 00038 #define OGRE_COMPILER_GNUC 2 00039 #define OGRE_COMPILER_BORL 3 00040 00041 #define OGRE_ENDIAN_LITTLE 1 00042 #define OGRE_ENDIAN_BIG 2 00043 00044 #define OGRE_ARCHITECTURE_32 1 00045 #define OGRE_ARCHITECTURE_64 2 00046 00047 /* Finds the compiler type and version. 00048 */ 00049 #if defined( _MSC_VER ) 00050 # define OGRE_COMPILER OGRE_COMPILER_MSVC 00051 # define OGRE_COMP_VER _MSC_VER 00052 00053 #elif defined( __GNUC__ ) 00054 # define OGRE_COMPILER OGRE_COMPILER_GNUC 00055 # define OGRE_COMP_VER (((__GNUC__)*100)+__GNUC_MINOR__) 00056 00057 #elif defined( __BORLANDC__ ) 00058 # define OGRE_COMPILER OGRE_COMPILER_BORL 00059 # define OGRE_COMP_VER __BCPLUSPLUS__ 00060 00061 #else 00062 # pragma error "No known compiler. Abort! Abort!" 00063 00064 #endif 00065 00066 /* See if we can use __forceinline or if we need to use __inline instead */ 00067 #if OGRE_COMPILER == OGRE_COMPILER_MSVC 00068 # if OGRE_COMP_VER >= 1200 00069 # define FORCEINLINE __forceinline 00070 # endif 00071 #else 00072 # define FORCEINLINE __inline 00073 #endif 00074 00075 /* Finds the current platform */ 00076 00077 #if defined( __WIN32__ ) || defined( _WIN32 ) 00078 # define OGRE_PLATFORM OGRE_PLATFORM_WIN32 00079 00080 #elif defined( __APPLE_CC__) 00081 # define OGRE_PLATFORM OGRE_PLATFORM_APPLE 00082 00083 #else 00084 # define OGRE_PLATFORM OGRE_PLATFORM_LINUX 00085 #endif 00086 00087 /* Find the arch type */ 00088 #if defined(__x86_64__) 00089 # define OGRE_ARCH_TYPE OGRE_ARCHITECTURE_64 00090 #else 00091 # define OGRE_ARCH_TYPE OGRE_ARCHITECTURE_32 00092 #endif 00093 // For generating compiler warnings - should work on any compiler 00094 // As a side note, if you start your message with 'Warning: ', the MSVC 00095 // IDE actually does catch a warning :) 00096 #define OGRE_QUOTE_INPLACE(x) # x 00097 #define OGRE_QUOTE(x) OGRE_QUOTE_INPLACE(x) 00098 #define OGRE_WARN( x ) message( __FILE__ "(" QUOTE( __LINE__ ) ") : " x "\n" ) 00099 00100 //---------------------------------------------------------------------------- 00101 // Windows Settings 00102 #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 00103 00104 // If we're not including this from a client build, specify that the stuff 00105 // should get exported. Otherwise, import it. 00106 # if defined( __MINGW32__ ) 00107 // Linux compilers don't have symbol import/export directives. 00108 # define _OgreExport 00109 # else 00110 # if defined( OGRE_NONCLIENT_BUILD ) 00111 # define _OgreExport __declspec( dllexport ) 00112 # else 00113 # define _OgreExport __declspec( dllimport ) 00114 # endif 00115 # endif 00116 // Win32 compilers use _DEBUG for specifying debug builds. 00117 # ifdef _DEBUG 00118 # define OGRE_DEBUG_MODE 1 00119 # else 00120 # define OGRE_DEBUG_MODE 0 00121 # endif 00122 00123 #if defined( __MINGW32__ ) 00124 #define GCC_3_1 00125 #define EXT_HASH 00126 #else 00127 #define snprintf _snprintf 00128 #define vsnprintf _vsnprintf 00129 #endif 00130 00131 #if OGRE_DEBUG_MODE 00132 #define OGRE_PLATFORM_LIB "OgrePlatform_d.dll" 00133 #else 00134 #define OGRE_PLATFORM_LIB "OgrePlatform.dll" 00135 #endif 00136 00137 #endif 00138 //---------------------------------------------------------------------------- 00139 00140 //---------------------------------------------------------------------------- 00141 // Linux/Apple Settings 00142 #if OGRE_PLATFORM == OGRE_PLATFORM_LINUX || OGRE_PLATFORM == OGRE_PLATFORM_APPLE 00143 00144 // Linux compilers don't have symbol import/export directives. 00145 # define _OgreExport 00146 00147 // A quick define to overcome different names for the same function 00148 # define stricmp strcasecmp 00149 00150 // Unlike the Win32 compilers, Linux compilers seem to use DEBUG for when 00151 // specifying a debug build. 00152 # ifdef DEBUG 00153 # define OGRE_DEBUG_MODE 1 00154 # else 00155 # define OGRE_DEBUG_MODE 0 00156 # endif 00157 00158 #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE 00159 #define OGRE_PLATFORM_LIB "OgrePlatform.bundle" 00160 #else 00161 //OGRE_PLATFORM_LINUX 00162 #define OGRE_PLATFORM_LIB "libOgrePlatform.so" 00163 #endif 00164 00165 #endif 00166 00167 //For apple, we always have a custom config.h file 00168 #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE 00169 # include "config.h" 00170 //SDL_main must be included in the file that contains 00171 //the application's main() function. 00172 #ifndef OGRE_NONCLIENT_BUILD 00173 # include <SDL/SDL_main.h> 00174 #endif 00175 00176 #endif 00177 00178 //---------------------------------------------------------------------------- 00179 00180 //---------------------------------------------------------------------------- 00181 // Endian Settings 00182 // check for BIG_ENDIAN config flag, set OGRE_ENDIAN correctly 00183 #ifdef CONFIG_BIG_ENDIAN 00184 # define OGRE_ENDIAN OGRE_ENDIAN_BIG 00185 #else 00186 # define OGRE_ENDIAN OGRE_ENDIAN_LITTLE 00187 #endif 00188 00189 // Integer formats of fixed bit width 00190 typedef unsigned int uint32; 00191 typedef unsigned short uint16; 00192 typedef unsigned char uint8; 00193 00194 } 00195 00196 #endif
Copyright © 2000-2005 by The OGRE Team
Last modified Sun Apr 10 23:21:20 2005