1 ////////////////////////////////////////////////////////////
\r
3 // SFML - Simple and Fast Multimedia Library
\r
4 // Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
\r
6 // This software is provided 'as-is', without any express or implied warranty.
\r
7 // In no event will the authors be held liable for any damages arising from the use of this software.
\r
9 // Permission is granted to anyone to use this software for any purpose,
\r
10 // including commercial applications, and to alter it and redistribute it freely,
\r
11 // subject to the following restrictions:
\r
13 // 1. The origin of this software must not be misrepresented;
\r
14 // you must not claim that you wrote the original software.
\r
15 // If you use this software in a product, an acknowledgment
\r
16 // in the product documentation would be appreciated but is not required.
\r
18 // 2. Altered source versions must be plainly marked as such,
\r
19 // and must not be misrepresented as being the original software.
\r
21 // 3. This notice may not be removed or altered from any source distribution.
\r
23 ////////////////////////////////////////////////////////////
\r
25 #ifndef SFML_CONFIG_HPP
\r
26 #define SFML_CONFIG_HPP
\r
28 ////////////////////////////////////////////////////////////
\r
29 // Identify the operating system
\r
30 ////////////////////////////////////////////////////////////
\r
31 #if defined(_WIN32) || defined(__WIN32__)
\r
34 #define SFML_SYSTEM_WINDOWS
\r
35 #ifndef WIN32_LEAN_AND_MEAN
\r
36 #define WIN32_LEAN_AND_MEAN
\r
42 #elif defined(linux) || defined(__linux)
\r
45 #define SFML_SYSTEM_LINUX
\r
47 #elif defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || defined(Macintosh)
\r
50 #define SFML_SYSTEM_MACOS
\r
52 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
\r
55 #define SFML_SYSTEM_FREEBSD
\r
59 // Unsupported system
\r
60 #error This operating system is not supported by SFML library
\r
65 ////////////////////////////////////////////////////////////
\r
66 // Define a portable debug macro
\r
67 ////////////////////////////////////////////////////////////
\r
68 #if !defined(NDEBUG)
\r
75 ////////////////////////////////////////////////////////////
\r
76 // Define portable import / export macros
\r
77 ////////////////////////////////////////////////////////////
\r
78 #if defined(SFML_SYSTEM_WINDOWS)
\r
82 // Windows platforms
\r
85 // From DLL side, we must export
\r
86 #define SFML_API __declspec(dllexport)
\r
90 // From client application side, we must import
\r
91 #define SFML_API __declspec(dllimport)
\r
95 // For Visual C++ compilers, we also need to turn off this annoying C4251 warning.
\r
96 // You can read lots ot different things about it, but the point is the code will
\r
97 // just work fine, and so the simplest way to get rid of this warning is to disable it
\r
100 #pragma warning(disable : 4251)
\r
106 // No specific directive needed for static build
\r
113 // Other platforms don't need to define anything
\r
119 ////////////////////////////////////////////////////////////
\r
120 // Define portable fixed-size types
\r
121 ////////////////////////////////////////////////////////////
\r
126 // 8 bits integer types
\r
127 #if UCHAR_MAX == 0xFF
\r
128 typedef signed char Int8;
\r
129 typedef unsigned char Uint8;
\r
131 #error No 8 bits integer type for this platform
\r
134 // 16 bits integer types
\r
135 #if USHRT_MAX == 0xFFFF
\r
136 typedef signed short Int16;
\r
137 typedef unsigned short Uint16;
\r
138 #elif UINT_MAX == 0xFFFF
\r
139 typedef signed int Int16;
\r
140 typedef unsigned int Uint16;
\r
141 #elif ULONG_MAX == 0xFFFF
\r
142 typedef signed long Int16;
\r
143 typedef unsigned long Uint16;
\r
145 #error No 16 bits integer type for this platform
\r
148 // 32 bits integer types
\r
149 #if USHRT_MAX == 0xFFFFFFFF
\r
150 typedef signed short Int32;
\r
151 typedef unsigned short Uint32;
\r
152 #elif UINT_MAX == 0xFFFFFFFF
\r
153 typedef signed int Int32;
\r
154 typedef unsigned int Uint32;
\r
155 #elif ULONG_MAX == 0xFFFFFFFF
\r
156 typedef signed long Int32;
\r
157 typedef unsigned long Uint32;
\r
159 #error No 32 bits integer type for this platform
\r
165 #endif // SFML_CONFIG_HPP
\r