D:/Programmation/Cpp/SFML/src/SFML/Config.hpp

00001 
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024 
00025 #ifndef SFML_CONFIG_HPP
00026 #define SFML_CONFIG_HPP
00027 
00029 // Identify the operating system
00031 #if defined(_WIN32) || defined(__WIN32__)
00032 
00033     // Windows
00034     #define SFML_SYSTEM_WINDOWS
00035     #define WIN32_LEAN_AND_MEAN
00036     #define NOMINMAX
00037     #include <windows.h>
00038     #undef DELETE
00039 
00040 #elif defined(linux) || defined(__linux)
00041 
00042     // Linux
00043     #define SFML_SYSTEM_LINUX
00044 
00045 #elif defined(__MACOSX__) || defined(__APPLE__) || defined(macintosh) || defined(Macintosh)
00046 
00047     // MacOS
00048     #define SFML_SYSTEM_MACOS
00049 
00050 #else
00051 
00052     // Unsupported system
00053     #error This operating system is not supported by SFML library
00054 
00055 #endif
00056 
00057 
00059 // Identify the platform
00061 #if defined(__i386__) || defined(_M_IX86) || defined(_X86_) || defined(__INTEL__) || defined(__i386)
00062 
00063     // Intel x86
00064     #define SFML_PLATFORM_X86
00065 
00066 #elif defined(__amd64__)
00067 
00068     // AMD64
00069     #define SFML_PLATFORM_AMD64
00070 
00071 #elif defined(__IA64__) || defined(_M_IA64)
00072 
00073     // Intel IA64
00074     #define SFML_PLATFORM_IA64
00075 
00076 #elif defined(__powerpc__) || defined(_M_PPC) || defined(_ARCH_PPC)
00077 
00078     // Apple PowerPC
00079     #define SFML_PLATFORM_POWERPC
00080 
00081 #else
00082 
00083     // Unsupported platform
00084     #error This platform is not supported by SFML library
00085 
00086 #endif
00087 
00088 
00090 // Define a portable debug macro
00092 #if defined(_DEBUG) || defined(DEBUG)
00093 
00094     #define SFML_DEBUG
00095 
00096 #endif
00097 
00098 
00100 // Define portable import / export macros
00102 #if defined(SFML_SYSTEM_WINDOWS)
00103 
00104     #ifdef SFML_DYNAMIC
00105 
00106         // Windows platforms
00107         #ifdef SFML_EXPORTS
00108 
00109             // From DLL side, we must export
00110             #define SFML_API __declspec(dllexport)
00111 
00112         #else
00113 
00114             // From client application side, we must import
00115             #define SFML_API __declspec(dllimport)
00116 
00117         #endif
00118 
00119         // For Visual C++ compilers, we also need to turn off this annoying C4251 warning.
00120         // You can read lots ot different things about it, but the point is the code will
00121         // just work fine, and so the simplest way to get rid of this warning is to disable it
00122         #ifdef _MSC_VER
00123 
00124             #pragma warning(disable : 4251)
00125 
00126         #endif
00127 
00128     #else
00129 
00130         // No specific directive needed for static build
00131         #define SFML_API
00132 
00133     #endif
00134 
00135 #else
00136 
00137     // Other platforms don't need to define anything
00138     #define SFML_API
00139 
00140 #endif
00141 
00142 
00144 // Define endianness depending on current platform
00146 #ifdef SFML_PLATFORM_POWERPC
00147 
00148     // Apple PowerPC processors are big endian
00149     #define SFML_BIG_ENDIAN
00150 
00151 #else
00152 
00153     // The other supported processors (x86, IA64, AMD64) are little endian
00154     #define SFML_LITTLE_ENDIAN
00155 
00156 #endif
00157 
00158 
00160 // Define portable types
00162 #include <climits>
00163 
00164 // 8 bits integer types
00165 #if UCHAR_MAX == 0xFF
00166     typedef char          sfInt8;
00167     typedef unsigned char sfUint8;
00168 #else
00169     #error No 8 bits integer type for this platform
00170 #endif
00171 
00172 // 16 bits integer types
00173 #if UCHAR_MAX == 0xFFFF
00174     typedef char          sfInt16;
00175     typedef unsigned char sfUint16;
00176 #elif USHRT_MAX == 0xFFFF
00177     typedef short          sfInt16;
00178     typedef unsigned short sfUint16;
00179 #elif UINT_MAX == 0xFFFF
00180     typedef int          sfInt16;
00181     typedef unsigned int sfUint16;
00182 #elif ULONG_MAX == 0xFFFF
00183     typedef long          sfInt16;
00184     typedef unsigned long sfUint16;
00185 #else
00186     #error No 16 bits integer type for this platform
00187 #endif
00188 
00189 // 32 bits integer types
00190 #if UCHAR_MAX == 0xFFFFFFFF
00191     typedef char          sfInt32;
00192     typedef unsigned char sfUint32;
00193 #elif USHRT_MAX == 0xFFFFFFFF
00194     typedef short          sfInt32;
00195     typedef unsigned short sfUint32;
00196 #elif UINT_MAX == 0xFFFFFFFF
00197     typedef int          sfInt32;
00198     typedef unsigned int sfUint32;
00199 #elif ULONG_MAX == 0xFFFFFFFF
00200     typedef long          sfInt32;
00201     typedef unsigned long sfUint32;
00202 #else
00203     #error No 32 bits integer type for this platform
00204 #endif
00205 
00206 
00207 #endif // SFML_CONFIG_HPP

Generated for SFML by  doxygen 1.5.2