CSFML

- Main Page
- Data Structures
- Files

- File List
- Globals

Config.h
Go to the documentation of this file.
1 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_CONFIG_H
26 #define SFML_CONFIG_H
27
28
30 // Define the CSFML version
32 #define CSFML_VERSION_MAJOR 2
33 #define CSFML_VERSION_MINOR 1
34
35
37 // Identify the operating system
39 #if defined(_WIN32) || defined(__WIN32__)
40
41 // Windows
42 #define CSFML_SYSTEM_WINDOWS
43
44 #elif defined(linux) || defined(__linux)
45
46 // Linux
47 #define CSFML_SYSTEM_LINUX
48
49 #elif defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || defined(Macintosh)
50
51 // MacOS
52 #define CSFML_SYSTEM_MACOS
53
54 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
55
56 // FreeBSD
57 #define CSFML_SYSTEM_FREEBSD
58
59 #else
60
61 // Unsupported system
62 #error This operating system is not supported by SFML library
63
64 #endif
65
66
68 // Define helpers to create portable import / export macros for each module
70 #if defined(CSFML_SYSTEM_WINDOWS)
71
72 // Windows compilers need specific (and different) keywords for export and import
73 #define CSFML_API_EXPORT extern "C" __declspec(dllexport)
74 #define CSFML_API_IMPORT extern __declspec(dllimport)
75
76 // For Visual C++ compilers, we also need to turn off this annoying C4251 warning
77 #ifdef _MSC_VER
78
79 #pragma warning(disable : 4251)
80
81 #endif
82
83 #else // Linux, FreeBSD, Mac OS X
84
85 #if __GNUC__ >= 4
86
87 // GCC 4 has special keywords for showing/hidding symbols,
88 // the same keyword is used for both importing and exporting
89 #define CSFML_API_EXPORT extern "C" __attribute__ ((__visibility__ ("default")))
90 #define CSFML_API_IMPORT extern __attribute__ ((__visibility__ ("default")))
91
92 #else
93
94 // GCC < 4 has no mechanism to explicitely hide symbols, everything's exported
95 #define CSFML_API_EXPORT extern "C"
96 #define CSFML_API_IMPORT extern
97
98 #endif
99
100 #endif
101
102
104 // Define a portable boolean type
106 typedef int sfBool;
107 #define sfFalse 0
108 #define sfTrue 1
109
110
112 // Define portable fixed-size types
114
115 // All "common" platforms use the same size for char, short and int
116 // (basically there are 3 types for 3 sizes, so no other match is possible),
117 // we can use them without doing any kind of check
118
119 // 8 bits integer types
120 typedef signed char sfInt8;
121 typedef unsigned char sfUint8;
122
123 // 16 bits integer types
124 typedef signed short sfInt16;
125 typedef unsigned short sfUint16;
126
127 // 32 bits integer types
128 typedef signed int sfInt32;
129 typedef unsigned int sfUint32;
130
131 // 64 bits integer types
132 #if defined(_MSC_VER)
133 typedef signed __int64 sfInt64;
134 typedef unsigned __int64 sfUint64;
135 #else
136 typedef signed long long sfInt64;
137 typedef unsigned long long sfUint64;
138 #endif
139
140
141 #endif // SFML_CONFIG_H