slouken@8582: /* slouken@8582: Simple DirectMedia Layer slouken@8149: Copyright (C) 1997-2014 Sam Lantinga slouken@8582: slouken@8582: This software is provided 'as-is', without any express or implied slouken@8582: warranty. In no event will the authors be held liable for any damages slouken@8582: arising from the use of this software. slouken@8582: slouken@8582: Permission is granted to anyone to use this software for any purpose, slouken@8582: including commercial applications, and to alter it and redistribute it slouken@8582: freely, subject to the following restrictions: slouken@8582: slouken@8582: 1. The origin of this software must not be misrepresented; you must not slouken@8582: claim that you wrote the original software. If you use this software slouken@8582: in a product, an acknowledgment in the product documentation would be slouken@8582: appreciated but is not required. slouken@8582: 2. Altered source versions must be plainly marked as such, and must not be slouken@8582: misrepresented as being the original software. slouken@8582: 3. This notice may not be removed or altered from any source distribution. slouken@8582: */ slouken@8582: slouken@8582: /** slouken@8582: * \file SDL_platform.h slouken@8582: * slouken@8582: * Try to get a standard set of platform defines. slouken@8582: */ slouken@8582: slouken@8582: #ifndef _SDL_platform_h slouken@8582: #define _SDL_platform_h slouken@8582: slouken@8582: #if defined(_AIX) slouken@8582: #undef __AIX__ slouken@8582: #define __AIX__ 1 slouken@8582: #endif slouken@8582: #if defined(__HAIKU__) slouken@8582: #undef __HAIKU__ slouken@8582: #define __HAIKU__ 1 slouken@8582: #endif slouken@8582: #if defined(bsdi) || defined(__bsdi) || defined(__bsdi__) slouken@8582: #undef __BSDI__ slouken@8582: #define __BSDI__ 1 slouken@8582: #endif slouken@8582: #if defined(_arch_dreamcast) slouken@8582: #undef __DREAMCAST__ slouken@8582: #define __DREAMCAST__ 1 slouken@8582: #endif slouken@8582: #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) slouken@8582: #undef __FREEBSD__ slouken@8582: #define __FREEBSD__ 1 slouken@8582: #endif slouken@8582: #if defined(hpux) || defined(__hpux) || defined(__hpux__) slouken@8582: #undef __HPUX__ slouken@8582: #define __HPUX__ 1 slouken@8582: #endif slouken@8582: #if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE) slouken@8582: #undef __IRIX__ slouken@8582: #define __IRIX__ 1 slouken@8582: #endif gabomdq@8833: #if (defined(linux) || defined(__linux) || defined(__linux__)) slouken@8582: #undef __LINUX__ slouken@8582: #define __LINUX__ 1 slouken@8582: #endif philipp@8150: #if defined(ANDROID) || defined(__ANDROID__) slouken@8582: #undef __ANDROID__ slouken@8582: #undef __LINUX__ /* do we need to do this? */ slouken@8582: #define __ANDROID__ 1 slouken@8582: #endif slouken@8582: slouken@8582: #if defined(__APPLE__) slouken@8582: /* lets us know what version of Mac OS X we're compiling on */ slouken@8582: #include "AvailabilityMacros.h" slouken@8582: #include "TargetConditionals.h" slouken@8582: #if TARGET_OS_IPHONE slouken@8582: /* if compiling for iPhone */ slouken@8582: #undef __IPHONEOS__ slouken@8582: #define __IPHONEOS__ 1 slouken@8582: #undef __MACOSX__ slouken@8582: #else slouken@8582: /* if not compiling for iPhone */ slouken@8582: #undef __MACOSX__ slouken@8582: #define __MACOSX__ 1 slouken@8582: #if MAC_OS_X_VERSION_MIN_REQUIRED < 1050 slouken@8582: # error SDL for Mac OS X only supports deploying on 10.5 and above. slouken@8582: #endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1050 */ slouken@8582: #endif /* TARGET_OS_IPHONE */ slouken@8582: #endif /* defined(__APPLE__) */ slouken@8582: slouken@8582: #if defined(__NetBSD__) slouken@8582: #undef __NETBSD__ slouken@8582: #define __NETBSD__ 1 slouken@8582: #endif slouken@8582: #if defined(__OpenBSD__) slouken@8582: #undef __OPENBSD__ slouken@8582: #define __OPENBSD__ 1 slouken@8582: #endif slouken@8582: #if defined(__OS2__) slouken@8582: #undef __OS2__ slouken@8582: #define __OS2__ 1 slouken@8582: #endif slouken@8582: #if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE) slouken@8582: #undef __OSF__ slouken@8582: #define __OSF__ 1 slouken@8582: #endif slouken@8582: #if defined(__QNXNTO__) slouken@8582: #undef __QNXNTO__ slouken@8582: #define __QNXNTO__ 1 slouken@8582: #endif slouken@8582: #if defined(riscos) || defined(__riscos) || defined(__riscos__) slouken@8582: #undef __RISCOS__ slouken@8582: #define __RISCOS__ 1 slouken@8582: #endif binarycrusader@8979: #if defined(__sun) && defined(__SVR4) slouken@8582: #undef __SOLARIS__ slouken@8582: #define __SOLARIS__ 1 slouken@8582: #endif slouken@8582: dludwig@8630: #if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) slouken@8582: /* Try to find out if we're compiling for WinRT or non-WinRT */ slouken@8614: /* If _USING_V110_SDK71_ is defined it means we are using the v110_xp or v120_xp toolset. */ dludwig@8630: #if (defined(_MSC_VER) && (_MSC_VER >= 1700) && !_USING_V110_SDK71_) /* _MSC_VER==1700 for MSVC 2012 */ slouken@8582: #include slouken@8584: #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) slouken@8582: #undef __WINDOWS__ slouken@8582: #define __WINDOWS__ 1 slouken@8582: /* See if we're compiling for WinRT: */ slouken@8582: #elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) slouken@8582: #undef __WINRT__ slouken@8582: #define __WINRT__ 1 slouken@8584: #endif slouken@8584: #else slouken@8584: #undef __WINDOWS__ slouken@8584: #define __WINDOWS__ 1 slouken@8584: #endif /* _MSC_VER < 1700 */ slouken@8582: #endif /* defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) */ slouken@8582: slouken@8582: #if defined(__WINDOWS__) slouken@8582: #undef __WIN32__ slouken@8582: #define __WIN32__ 1 slouken@8582: #endif slouken@8582: #if defined(__PSP__) slouken@8582: #undef __PSP__ slouken@8582: #define __PSP__ 1 slouken@8582: #endif slouken@8582: gabomdq@8833: /* The NACL compiler defines __native_client__ and __pnacl__ gabomdq@8833: * Ref: http://www.chromium.org/nativeclient/pnacl/stability-of-the-pnacl-bitcode-abi gabomdq@8833: */ gabomdq@8833: #if defined(__native_client__) gabomdq@8833: #undef __LINUX__ gabomdq@8833: #undef __NACL__ gabomdq@8833: #define __NACL__ 1 gabomdq@8833: #endif gabomdq@8833: #if defined(__pnacl__) gabomdq@8833: #undef __LINUX__ gabomdq@8833: #undef __PNACL__ gabomdq@8833: #define __PNACL__ 1 gabomdq@8833: /* PNACL with newlib supports static linking only */ gabomdq@8833: #define __SDL_NOGETPROCADDR__ gabomdq@8833: #endif gabomdq@8833: gabomdq@8833: slouken@8582: #include "begin_code.h" slouken@8582: /* Set up for C function definitions, even when using C++ */ slouken@8582: #ifdef __cplusplus slouken@8582: extern "C" { slouken@8582: #endif slouken@8582: slouken@8582: /** slouken@8582: * \brief Gets the name of the platform. slouken@8582: */ slouken@8582: extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void); slouken@8582: slouken@8582: /* Ends C function definitions when using C++ */ slouken@8582: #ifdef __cplusplus slouken@8582: } slouken@8582: #endif slouken@8582: #include "close_code.h" slouken@8582: slouken@8582: #endif /* _SDL_platform_h */ slouken@8582: slouken@8582: /* vi: set ts=4 sw=4 expandtab: */