Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-02 08:58:15

0001 ////////////////////////////////////////////////////////////
0002 //
0003 // SFML - Simple and Fast Multimedia Library
0004 // Copyright (C) 2007-2023 Laurent Gomila (laurent@sfml-dev.org)
0005 //
0006 // This software is provided 'as-is', without any express or implied warranty.
0007 // In no event will the authors be held liable for any damages arising from the use of this software.
0008 //
0009 // Permission is granted to anyone to use this software for any purpose,
0010 // including commercial applications, and to alter it and redistribute it freely,
0011 // subject to the following restrictions:
0012 //
0013 // 1. The origin of this software must not be misrepresented;
0014 //    you must not claim that you wrote the original software.
0015 //    If you use this software in a product, an acknowledgment
0016 //    in the product documentation would be appreciated but is not required.
0017 //
0018 // 2. Altered source versions must be plainly marked as such,
0019 //    and must not be misrepresented as being the original software.
0020 //
0021 // 3. This notice may not be removed or altered from any source distribution.
0022 //
0023 ////////////////////////////////////////////////////////////
0024 
0025 #ifndef SFML_CONFIG_HPP
0026 #define SFML_CONFIG_HPP
0027 
0028 
0029 ////////////////////////////////////////////////////////////
0030 // Define the SFML version
0031 ////////////////////////////////////////////////////////////
0032 #define SFML_VERSION_MAJOR 2
0033 #define SFML_VERSION_MINOR 6
0034 #define SFML_VERSION_PATCH 2
0035 
0036 
0037 ////////////////////////////////////////////////////////////
0038 // Identify the operating system
0039 // see https://sourceforge.net/p/predef/wiki/Home/
0040 ////////////////////////////////////////////////////////////
0041 #if defined(_WIN32)
0042 
0043     // Windows
0044     #define SFML_SYSTEM_WINDOWS
0045     #ifndef NOMINMAX
0046         #define NOMINMAX
0047     #endif
0048 
0049 #elif defined(__APPLE__) && defined(__MACH__)
0050 
0051     // Apple platform, see which one it is
0052     #include "TargetConditionals.h"
0053 
0054     #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
0055 
0056         // iOS
0057         #define SFML_SYSTEM_IOS
0058 
0059     #elif TARGET_OS_MAC
0060 
0061         // MacOS
0062         #define SFML_SYSTEM_MACOS
0063 
0064     #else
0065 
0066         // Unsupported Apple system
0067         #error This Apple operating system is not supported by SFML library
0068 
0069     #endif
0070 
0071 #elif defined(__unix__)
0072 
0073     // UNIX system, see which one it is
0074     #if defined(__ANDROID__)
0075 
0076         // Android
0077         #define SFML_SYSTEM_ANDROID
0078 
0079     #elif defined(__linux__)
0080 
0081          // Linux
0082         #define SFML_SYSTEM_LINUX
0083 
0084     #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
0085 
0086         // FreeBSD
0087         #define SFML_SYSTEM_FREEBSD
0088 
0089     #elif defined(__OpenBSD__)
0090 
0091         // OpenBSD
0092         #define SFML_SYSTEM_OPENBSD
0093 
0094     #elif defined(__NetBSD__)
0095 
0096         // NetBSD
0097         #define SFML_SYSTEM_NETBSD
0098 
0099     #else
0100 
0101         // Unsupported UNIX system
0102         #error This UNIX operating system is not supported by SFML library
0103 
0104     #endif
0105 
0106 #else
0107 
0108     // Unsupported system
0109     #error This operating system is not supported by SFML library
0110 
0111 #endif
0112 
0113 
0114 ////////////////////////////////////////////////////////////
0115 // Define a portable debug macro
0116 ////////////////////////////////////////////////////////////
0117 #if !defined(NDEBUG)
0118 
0119     #define SFML_DEBUG
0120 
0121 #endif
0122 
0123 
0124 ////////////////////////////////////////////////////////////
0125 // Define helpers to create portable import / export macros for each module
0126 ////////////////////////////////////////////////////////////
0127 #if !defined(SFML_STATIC)
0128 
0129     #if defined(SFML_SYSTEM_WINDOWS)
0130 
0131         // Windows compilers need specific (and different) keywords for export and import
0132         #define SFML_API_EXPORT __declspec(dllexport)
0133         #define SFML_API_IMPORT __declspec(dllimport)
0134 
0135         // For Visual C++ compilers, we also need to turn off this annoying C4251 warning
0136         #ifdef _MSC_VER
0137 
0138             #pragma warning(disable: 4251)
0139 
0140         #endif
0141 
0142     #else // Linux, FreeBSD, Mac OS X
0143 
0144         #if __GNUC__ >= 4
0145 
0146             // GCC 4 has special keywords for showing/hidding symbols,
0147             // the same keyword is used for both importing and exporting
0148             #define SFML_API_EXPORT __attribute__ ((__visibility__ ("default")))
0149             #define SFML_API_IMPORT __attribute__ ((__visibility__ ("default")))
0150 
0151         #else
0152 
0153             // GCC < 4 has no mechanism to explicitely hide symbols, everything's exported
0154             #define SFML_API_EXPORT
0155             #define SFML_API_IMPORT
0156 
0157         #endif
0158 
0159     #endif
0160 
0161 #else
0162 
0163     // Static build doesn't need import/export macros
0164     #define SFML_API_EXPORT
0165     #define SFML_API_IMPORT
0166 
0167 #endif
0168 
0169 
0170 ////////////////////////////////////////////////////////////
0171 // Cross-platform warning for deprecated functions and classes
0172 //
0173 // Usage:
0174 // class SFML_DEPRECATED MyClass
0175 // {
0176 //     SFML_DEPRECATED void memberFunc();
0177 // };
0178 //
0179 // SFML_DEPRECATED void globalFunc();
0180 ////////////////////////////////////////////////////////////
0181 #if defined(SFML_NO_DEPRECATED_WARNINGS)
0182 
0183     // User explicitly requests to disable deprecation warnings
0184     #define SFML_DEPRECATED
0185 
0186 #elif defined(_MSC_VER)
0187 
0188     // Microsoft C++ compiler
0189     // Note: On newer MSVC versions, using deprecated functions causes a compiler error. In order to
0190     // trigger a warning instead of an error, the compiler flag /sdl- (instead of /sdl) must be specified.
0191     #define SFML_DEPRECATED __declspec(deprecated)
0192 
0193 #elif defined(__GNUC__)
0194 
0195     // g++ and Clang
0196     #define SFML_DEPRECATED __attribute__ ((deprecated))
0197 
0198 #else
0199 
0200     // Other compilers are not supported, leave class or function as-is.
0201     // With a bit of luck, the #pragma directive works, otherwise users get a warning (no error!) for unrecognized #pragma.
0202     #pragma message("SFML_DEPRECATED is not supported for your compiler, please contact the SFML team")
0203     #define SFML_DEPRECATED
0204 
0205 #endif
0206 
0207 
0208 ////////////////////////////////////////////////////////////
0209 // Define portable fixed-size types
0210 ////////////////////////////////////////////////////////////
0211 namespace sf
0212 {
0213     // All "common" platforms use the same size for char, short and int
0214     // (basically there are 3 types for 3 sizes, so no other match is possible),
0215     // we can use them without doing any kind of check
0216 
0217     // 8 bits integer types
0218     typedef signed   char Int8;
0219     typedef unsigned char Uint8;
0220 
0221     // 16 bits integer types
0222     typedef signed   short Int16;
0223     typedef unsigned short Uint16;
0224 
0225     // 32 bits integer types
0226     typedef signed   int Int32;
0227     typedef unsigned int Uint32;
0228 
0229     // 64 bits integer types
0230     #if defined(_MSC_VER)
0231         typedef signed   __int64 Int64;
0232         typedef unsigned __int64 Uint64;
0233     #else
0234         #if defined(__clang__)
0235             #pragma clang diagnostic push
0236             #pragma clang diagnostic ignored "-Wc++11-long-long"
0237         #endif
0238         typedef signed   long long Int64;
0239         typedef unsigned long long Uint64;
0240         #if defined(__clang__)
0241             #pragma clang diagnostic pop
0242         #endif
0243     #endif
0244 
0245 } // namespace sf
0246 
0247 
0248 #endif // SFML_CONFIG_HPP