SFML logo
  • Main Page
  • Modules
  • Classes
  • Files
  • File List

Config.hpp

00001 
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2009 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 
00028 
00030 // Define the SFML version
00032 #define SFML_VERSION_MAJOR 2
00033 #define SFML_VERSION_MINOR 0
00034 
00035 
00037 // Identify the operating system
00039 #if defined(_WIN32) || defined(__WIN32__)
00040 
00041     // Windows
00042     #define SFML_SYSTEM_WINDOWS
00043     #ifndef NOMINMAX
00044         #define NOMINMAX
00045     #endif
00046 
00047 #elif defined(linux) || defined(__linux)
00048 
00049     // Linux
00050     #define SFML_SYSTEM_LINUX
00051 
00052 #elif defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || defined(Macintosh)
00053 
00054     // MacOS
00055     #define SFML_SYSTEM_MACOS
00056 
00057 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
00058 
00059     // FreeBSD
00060     #define SFML_SYSTEM_FREEBSD
00061 
00062 #else
00063 
00064     // Unsupported system
00065     #error This operating system is not supported by SFML library
00066 
00067 #endif
00068 
00069 
00071 // Identify the endianess
00073 #if defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || (defined(__MIPS__) && defined(__MISPEB__)) || \
00074     defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || defined(__sparc__) || defined(__hppa__)
00075 
00076     // Big endian
00077     #define SFML_ENDIAN_BIG
00078 
00079 #else
00080 
00081     // Little endian
00082     #define SFML_ENDIAN_LITTLE
00083 
00084 #endif
00085 
00086 
00088 // Define a portable debug macro
00090 #if !defined(NDEBUG)
00091 
00092     #define SFML_DEBUG
00093 
00094 #endif
00095 
00096 
00098 // Define portable import / export macros
00100 #if defined(SFML_SYSTEM_WINDOWS) && !defined(SFML_STATIC)
00101 
00102     #ifdef SFML_EXPORTS
00103 
00104         // From DLL side, we must export
00105         #define SFML_API __declspec(dllexport)
00106 
00107     #else
00108 
00109         // From client application side, we must import
00110         #define SFML_API __declspec(dllimport)
00111 
00112     #endif
00113 
00114     // For Visual C++ compilers, we also need to turn off this annoying C4251 warning.
00115     // You can read lots ot different things about it, but the point is the code will
00116     // just work fine, and so the simplest way to get rid of this warning is to disable it
00117     #ifdef _MSC_VER
00118 
00119         #pragma warning(disable : 4251)
00120 
00121     #endif
00122 
00123 #else
00124 
00125     // Other platforms and static build don't need these export macros
00126     #define SFML_API
00127 
00128 #endif
00129 
00130 
00132 // Define portable fixed-size types
00134 namespace sf
00135 {
00136     // All "common" platforms use the same size for char, short and int
00137     // (basically there are 3 types for 3 sizes, so no other match is possible),
00138     // we can use them without doing any kind of check
00139 
00140     // 8 bits integer types
00141     typedef signed   char Int8;
00142     typedef unsigned char Uint8;
00143 
00144     // 16 bits integer types
00145     typedef signed   short Int16;
00146     typedef unsigned short Uint16;
00147 
00148     // 32 bits integer types
00149     typedef signed   int Int32;
00150     typedef unsigned int Uint32;
00151 
00152     // 64 bits integer types
00153     #if defined(_MSC_VER)
00154         typedef signed   __int64 Int64;
00155         typedef unsigned __int64 Uint64;
00156     #else
00157         typedef signed   long long Int64;
00158         typedef unsigned long long Uint64;
00159     #endif
00160 
00161 } // namespace sf
00162 
00163 
00164 #endif // SFML_CONFIG_HPP

 ::  Copyright © 2007-2008 Laurent Gomila, all rights reserved  ::  Documentation generated by doxygen 1.5.2  ::