include/SDL_platform.h
changeset 8535 e8ee0708ef5c
parent 8478 337b5dc0797b
parent 7856 cb37776926ad
child 8543 b9dd3cf38585
     1.1 --- a/include/SDL_platform.h	Sun Oct 27 14:31:57 2013 -0400
     1.2 +++ b/include/SDL_platform.h	Sun Oct 27 21:26:46 2013 -0400
     1.3 @@ -1,168 +1,172 @@
     1.4 -/*
     1.5 -  Simple DirectMedia Layer
     1.6 -  Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
     1.7 -
     1.8 -  This software is provided 'as-is', without any express or implied
     1.9 -  warranty.  In no event will the authors be held liable for any damages
    1.10 -  arising from the use of this software.
    1.11 -
    1.12 -  Permission is granted to anyone to use this software for any purpose,
    1.13 -  including commercial applications, and to alter it and redistribute it
    1.14 -  freely, subject to the following restrictions:
    1.15 -
    1.16 -  1. The origin of this software must not be misrepresented; you must not
    1.17 -     claim that you wrote the original software. If you use this software
    1.18 -     in a product, an acknowledgment in the product documentation would be
    1.19 -     appreciated but is not required.
    1.20 -  2. Altered source versions must be plainly marked as such, and must not be
    1.21 -     misrepresented as being the original software.
    1.22 -  3. This notice may not be removed or altered from any source distribution.
    1.23 -*/
    1.24 -
    1.25 -/**
    1.26 - *  \file SDL_platform.h
    1.27 - *
    1.28 - *  Try to get a standard set of platform defines.
    1.29 - */
    1.30 -
    1.31 -#ifndef _SDL_platform_h
    1.32 -#define _SDL_platform_h
    1.33 -
    1.34 -#if defined(_AIX)
    1.35 -#undef __AIX__
    1.36 -#define __AIX__     1
    1.37 -#endif
    1.38 -#if defined(__BEOS__)
    1.39 -#undef __BEOS__
    1.40 -#define __BEOS__    1
    1.41 -#endif
    1.42 -#if defined(__HAIKU__)
    1.43 -#undef __HAIKU__
    1.44 -#define __HAIKU__   1
    1.45 -#endif
    1.46 -#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__)
    1.47 -#undef __BSDI__
    1.48 -#define __BSDI__    1
    1.49 -#endif
    1.50 -#if defined(_arch_dreamcast)
    1.51 -#undef __DREAMCAST__
    1.52 -#define __DREAMCAST__   1
    1.53 -#endif
    1.54 -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
    1.55 -#undef __FREEBSD__
    1.56 -#define __FREEBSD__ 1
    1.57 -#endif
    1.58 -#if defined(hpux) || defined(__hpux) || defined(__hpux__)
    1.59 -#undef __HPUX__
    1.60 -#define __HPUX__    1
    1.61 -#endif
    1.62 -#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE)
    1.63 -#undef __IRIX__
    1.64 -#define __IRIX__    1
    1.65 -#endif
    1.66 -#if defined(linux) || defined(__linux) || defined(__linux__)
    1.67 -#undef __LINUX__
    1.68 -#define __LINUX__   1
    1.69 -#endif
    1.70 -#if defined(ANDROID)
    1.71 -#undef __ANDROID__
    1.72 -#undef __LINUX__ /*do we need to do this?*/
    1.73 -#define __ANDROID__ 1
    1.74 -#endif
    1.75 -
    1.76 -#if defined(__APPLE__)
    1.77 -/* lets us know what version of Mac OS X we're compiling on */
    1.78 -#include "AvailabilityMacros.h"
    1.79 -#include "TargetConditionals.h"
    1.80 -#if TARGET_OS_IPHONE
    1.81 -/* if compiling for iPhone */
    1.82 -#undef __IPHONEOS__
    1.83 -#define __IPHONEOS__ 1
    1.84 -#undef __MACOSX__
    1.85 -#else
    1.86 -/* if not compiling for iPhone */
    1.87 -#undef __MACOSX__
    1.88 -#define __MACOSX__  1
    1.89 -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050
    1.90 -# error SDL for Mac OS X only supports deploying on 10.5 and above.
    1.91 -#endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1050 */
    1.92 -#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
    1.93 -# error SDL for Mac OS X must be built with a 10.6 SDK or above.
    1.94 -#endif /* MAC_OS_X_VERSION_MAX_ALLOWED < 1060 */
    1.95 -#endif /* TARGET_OS_IPHONE */
    1.96 -#endif /* defined(__APPLE__) */
    1.97 -
    1.98 -#if defined(__NetBSD__)
    1.99 -#undef __NETBSD__
   1.100 -#define __NETBSD__  1
   1.101 -#endif
   1.102 -#if defined(__OpenBSD__)
   1.103 -#undef __OPENBSD__
   1.104 -#define __OPENBSD__ 1
   1.105 -#endif
   1.106 -#if defined(__OS2__)
   1.107 -#undef __OS2__
   1.108 -#define __OS2__     1
   1.109 -#endif
   1.110 -#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE)
   1.111 -#undef __OSF__
   1.112 -#define __OSF__     1
   1.113 -#endif
   1.114 -#if defined(__QNXNTO__)
   1.115 -#undef __QNXNTO__
   1.116 -#define __QNXNTO__  1
   1.117 -#endif
   1.118 -#if defined(riscos) || defined(__riscos) || defined(__riscos__)
   1.119 -#undef __RISCOS__
   1.120 -#define __RISCOS__  1
   1.121 -#endif
   1.122 -#if defined(__SVR4)
   1.123 -#undef __SOLARIS__
   1.124 -#define __SOLARIS__ 1
   1.125 -#endif
   1.126 -
   1.127 +/*
   1.128 +  Simple DirectMedia Layer
   1.129 +  Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
   1.130 +
   1.131 +  This software is provided 'as-is', without any express or implied
   1.132 +  warranty.  In no event will the authors be held liable for any damages
   1.133 +  arising from the use of this software.
   1.134 +
   1.135 +  Permission is granted to anyone to use this software for any purpose,
   1.136 +  including commercial applications, and to alter it and redistribute it
   1.137 +  freely, subject to the following restrictions:
   1.138 +
   1.139 +  1. The origin of this software must not be misrepresented; you must not
   1.140 +     claim that you wrote the original software. If you use this software
   1.141 +     in a product, an acknowledgment in the product documentation would be
   1.142 +     appreciated but is not required.
   1.143 +  2. Altered source versions must be plainly marked as such, and must not be
   1.144 +     misrepresented as being the original software.
   1.145 +  3. This notice may not be removed or altered from any source distribution.
   1.146 +*/
   1.147 +
   1.148 +/**
   1.149 + *  \file SDL_platform.h
   1.150 + *
   1.151 + *  Try to get a standard set of platform defines.
   1.152 + */
   1.153 +
   1.154 +#ifndef _SDL_platform_h
   1.155 +#define _SDL_platform_h
   1.156 +
   1.157 +#if defined(_AIX)
   1.158 +#undef __AIX__
   1.159 +#define __AIX__     1
   1.160 +#endif
   1.161 +#if defined(__BEOS__)
   1.162 +#undef __BEOS__
   1.163 +#define __BEOS__    1
   1.164 +#endif
   1.165 +#if defined(__HAIKU__)
   1.166 +#undef __HAIKU__
   1.167 +#define __HAIKU__   1
   1.168 +#endif
   1.169 +#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__)
   1.170 +#undef __BSDI__
   1.171 +#define __BSDI__    1
   1.172 +#endif
   1.173 +#if defined(_arch_dreamcast)
   1.174 +#undef __DREAMCAST__
   1.175 +#define __DREAMCAST__   1
   1.176 +#endif
   1.177 +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
   1.178 +#undef __FREEBSD__
   1.179 +#define __FREEBSD__ 1
   1.180 +#endif
   1.181 +#if defined(hpux) || defined(__hpux) || defined(__hpux__)
   1.182 +#undef __HPUX__
   1.183 +#define __HPUX__    1
   1.184 +#endif
   1.185 +#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE)
   1.186 +#undef __IRIX__
   1.187 +#define __IRIX__    1
   1.188 +#endif
   1.189 +#if defined(linux) || defined(__linux) || defined(__linux__)
   1.190 +#undef __LINUX__
   1.191 +#define __LINUX__   1
   1.192 +#endif
   1.193 +#if defined(ANDROID)
   1.194 +#undef __ANDROID__
   1.195 +#undef __LINUX__ /* do we need to do this? */
   1.196 +#define __ANDROID__ 1
   1.197 +#endif
   1.198 +
   1.199 +#if defined(__APPLE__)
   1.200 +/* lets us know what version of Mac OS X we're compiling on */
   1.201 +#include "AvailabilityMacros.h"
   1.202 +#include "TargetConditionals.h"
   1.203 +#if TARGET_OS_IPHONE
   1.204 +/* if compiling for iPhone */
   1.205 +#undef __IPHONEOS__
   1.206 +#define __IPHONEOS__ 1
   1.207 +#undef __MACOSX__
   1.208 +#else
   1.209 +/* if not compiling for iPhone */
   1.210 +#undef __MACOSX__
   1.211 +#define __MACOSX__  1
   1.212 +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050
   1.213 +# error SDL for Mac OS X only supports deploying on 10.5 and above.
   1.214 +#endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1050 */
   1.215 +#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
   1.216 +# error SDL for Mac OS X must be built with a 10.6 SDK or above.
   1.217 +#endif /* MAC_OS_X_VERSION_MAX_ALLOWED < 1060 */
   1.218 +#endif /* TARGET_OS_IPHONE */
   1.219 +#endif /* defined(__APPLE__) */
   1.220 +
   1.221 +#if defined(__NetBSD__)
   1.222 +#undef __NETBSD__
   1.223 +#define __NETBSD__  1
   1.224 +#endif
   1.225 +#if defined(__OpenBSD__)
   1.226 +#undef __OPENBSD__
   1.227 +#define __OPENBSD__ 1
   1.228 +#endif
   1.229 +#if defined(__OS2__)
   1.230 +#undef __OS2__
   1.231 +#define __OS2__     1
   1.232 +#endif
   1.233 +#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE)
   1.234 +#undef __OSF__
   1.235 +#define __OSF__     1
   1.236 +#endif
   1.237 +#if defined(__QNXNTO__)
   1.238 +#undef __QNXNTO__
   1.239 +#define __QNXNTO__  1
   1.240 +#endif
   1.241 +#if defined(riscos) || defined(__riscos) || defined(__riscos__)
   1.242 +#undef __RISCOS__
   1.243 +#define __RISCOS__  1
   1.244 +#endif
   1.245 +#if defined(__SVR4)
   1.246 +#undef __SOLARIS__
   1.247 +#define __SOLARIS__ 1
   1.248 +#endif
   1.249 +
   1.250  #if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__)
   1.251 -/* Try to find out what version of Windows we are compiling for */
   1.252 +/* Try to find out if we're compiling for WinRT or non-WinRT */
   1.253  #if defined(_MSC_VER) && (_MSC_VER >= 1700)	/* _MSC_VER==1700 for MSVC 2012 */
   1.254  #include <winapifamily.h>
   1.255 -#endif
   1.256 -/* Default to classic, Win32 / Desktop compilation either if:
   1.257 +#endif /* _MSC_VER >= 1700 */
   1.258 +/* Default to classic, Win32/Win64/Desktop compilation either if:
   1.259       1. the version of Windows is explicity set to a 'Desktop' (non-Metro) app
   1.260       2. the version of Windows cannot be determined via winapifamily.h
   1.261 -   If neither is true, see if we're compiling for WinRT.
   1.262 +   If neither is true, then see if we're compiling for WinRT.
   1.263   */
   1.264  #if ! defined(WINAPI_FAMILY_PARTITION) || WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
   1.265 -#undef __WIN32__
   1.266 -#define __WIN32__   1
   1.267 +#undef __WINDOWS__
   1.268 +#define __WINDOWS__   1
   1.269  /* See if we're compiling for WinRT: */
   1.270  #elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
   1.271  #undef __WINRT__
   1.272  #define __WINRT__ 1
   1.273  #endif /* ! defined(WINAPI_FAMILY_PARTITION) */
   1.274 -#endif /* defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) */
   1.275 -
   1.276 -#if defined(__PSP__)
   1.277 -#undef __PSP__
   1.278 -#define __PSP__ 1
   1.279 -#endif
   1.280 -
   1.281 -#include "begin_code.h"
   1.282 -/* Set up for C function definitions, even when using C++ */
   1.283 -#ifdef __cplusplus
   1.284 -extern "C" {
   1.285 -#endif
   1.286 -
   1.287 -/**
   1.288 - *  \brief Gets the name of the platform.
   1.289 - */
   1.290 -extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void);
   1.291 -
   1.292 -/* Ends C function definitions when using C++ */
   1.293 -#ifdef __cplusplus
   1.294 -}
   1.295 -#endif
   1.296 -#include "close_code.h"
   1.297 -
   1.298 -#endif /* _SDL_platform_h */
   1.299 -
   1.300 -/* vi: set ts=4 sw=4 expandtab: */
   1.301 +#endif /* defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) */
   1.302 +
   1.303 +#if defined(__WINDOWS__)
   1.304 +#undef __WIN32__
   1.305 +#define __WIN32__ 1
   1.306 +#endif
   1.307 +#if defined(__PSP__)
   1.308 +#undef __PSP__
   1.309 +#define __PSP__ 1
   1.310 +#endif
   1.311 +
   1.312 +#include "begin_code.h"
   1.313 +/* Set up for C function definitions, even when using C++ */
   1.314 +#ifdef __cplusplus
   1.315 +extern "C" {
   1.316 +#endif
   1.317 +
   1.318 +/**
   1.319 + *  \brief Gets the name of the platform.
   1.320 + */
   1.321 +extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void);
   1.322 +
   1.323 +/* Ends C function definitions when using C++ */
   1.324 +#ifdef __cplusplus
   1.325 +}
   1.326 +#endif
   1.327 +#include "close_code.h"
   1.328 +
   1.329 +#endif /* _SDL_platform_h */
   1.330 +
   1.331 +/* vi: set ts=4 sw=4 expandtab: */