SFML logo
  • Main Page
  • Data Structures
  • Files
  • File List
  • Globals

Config.h

Go to the documentation of this file.
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_H
00026 #define SFML_CONFIG_H
00027 
00028 
00030 // Identify the operating system
00032 #if defined(_WIN32) || defined(__WIN32__)
00033 
00034     // Windows
00035     #define CSFML_SYSTEM_WINDOWS
00036 
00037 #elif defined(linux) || defined(__linux)
00038 
00039     // Linux
00040     #define CSFML_SYSTEM_LINUX
00041 
00042 #elif defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || defined(Macintosh)
00043 
00044     // MacOS
00045     #define CSFML_SYSTEM_MACOS
00046 
00047 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
00048 
00049     // FreeBSD
00050     #define CSFML_SYSTEM_FREEBSD
00051 
00052 #else
00053 
00054     // Unsupported system
00055     #error This operating system is not supported by SFML library
00056 
00057 #endif
00058 
00059 
00061 // Define portable import / export macros
00063 #ifdef CSFML_EXPORTS
00064 
00065     #define CSFML_API extern "C"
00066 
00067 #else
00068 
00069     #define CSFML_API extern
00070 
00071 #endif
00072 
00073 
00075 // Define a portable boolean type
00077 typedef int sfBool;
00078 #define sfFalse 0
00079 #define sfTrue  1
00080 
00081 
00083 // Define portable types
00085 #include <stdlib.h>
00086 #include <limits.h>
00087 
00088 // 8 bits integer types
00089 #if UCHAR_MAX == 0xFF
00090     typedef signed   char sfInt8;
00091     typedef unsigned char sfUint8;
00092 #else
00093     #error No 8 bits integer type for this platform
00094 #endif
00095 
00096 // 16 bits integer types
00097 #if USHRT_MAX == 0xFFFF
00098     typedef signed   short sfInt16;
00099     typedef unsigned short sfUint16;
00100 #elif UINT_MAX == 0xFFFF
00101     typedef signed   int sfInt16;
00102     typedef unsigned int sfUint16;
00103 #elif ULONG_MAX == 0xFFFF
00104     typedef signed   long sfInt16;
00105     typedef unsigned long sfUint16;
00106 #else
00107     #error No 16 bits integer type for this platform
00108 #endif
00109 
00110 // 32 bits integer types
00111 #if USHRT_MAX == 0xFFFFFFFF
00112     typedef signed   short sfInt32;
00113     typedef unsigned short sfUint32;
00114 #elif UINT_MAX == 0xFFFFFFFF
00115     typedef signed   int sfInt32;
00116     typedef unsigned int sfUint32;
00117 #elif ULONG_MAX == 0xFFFFFFFF
00118     typedef signed   long sfInt32;
00119     typedef unsigned long sfUint32;
00120 #else
00121     #error No 32 bits integer type for this platform
00122 #endif
00123 
00124 
00125 #endif // SFML_CONFIG_H

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