SDL Library
SDL_platform.h@0:7fb6877b5d7c, 2016-09-22 (annotated)
- Committer:
- miruga27
- Date:
- Thu Sep 22 00:03:09 2016 +0000
- Revision:
- 0:7fb6877b5d7c
SDL
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
miruga27 | 0:7fb6877b5d7c | 1 | /* |
miruga27 | 0:7fb6877b5d7c | 2 | Simple DirectMedia Layer |
miruga27 | 0:7fb6877b5d7c | 3 | Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org> |
miruga27 | 0:7fb6877b5d7c | 4 | |
miruga27 | 0:7fb6877b5d7c | 5 | This software is provided 'as-is', without any express or implied |
miruga27 | 0:7fb6877b5d7c | 6 | warranty. In no event will the authors be held liable for any damages |
miruga27 | 0:7fb6877b5d7c | 7 | arising from the use of this software. |
miruga27 | 0:7fb6877b5d7c | 8 | |
miruga27 | 0:7fb6877b5d7c | 9 | Permission is granted to anyone to use this software for any purpose, |
miruga27 | 0:7fb6877b5d7c | 10 | including commercial applications, and to alter it and redistribute it |
miruga27 | 0:7fb6877b5d7c | 11 | freely, subject to the following restrictions: |
miruga27 | 0:7fb6877b5d7c | 12 | |
miruga27 | 0:7fb6877b5d7c | 13 | 1. The origin of this software must not be misrepresented; you must not |
miruga27 | 0:7fb6877b5d7c | 14 | claim that you wrote the original software. If you use this software |
miruga27 | 0:7fb6877b5d7c | 15 | in a product, an acknowledgment in the product documentation would be |
miruga27 | 0:7fb6877b5d7c | 16 | appreciated but is not required. |
miruga27 | 0:7fb6877b5d7c | 17 | 2. Altered source versions must be plainly marked as such, and must not be |
miruga27 | 0:7fb6877b5d7c | 18 | misrepresented as being the original software. |
miruga27 | 0:7fb6877b5d7c | 19 | 3. This notice may not be removed or altered from any source distribution. |
miruga27 | 0:7fb6877b5d7c | 20 | */ |
miruga27 | 0:7fb6877b5d7c | 21 | |
miruga27 | 0:7fb6877b5d7c | 22 | /** |
miruga27 | 0:7fb6877b5d7c | 23 | * \file SDL_platform.h |
miruga27 | 0:7fb6877b5d7c | 24 | * |
miruga27 | 0:7fb6877b5d7c | 25 | * Try to get a standard set of platform defines. |
miruga27 | 0:7fb6877b5d7c | 26 | */ |
miruga27 | 0:7fb6877b5d7c | 27 | |
miruga27 | 0:7fb6877b5d7c | 28 | #ifndef _SDL_platform_h |
miruga27 | 0:7fb6877b5d7c | 29 | #define _SDL_platform_h |
miruga27 | 0:7fb6877b5d7c | 30 | |
miruga27 | 0:7fb6877b5d7c | 31 | #if defined(_AIX) |
miruga27 | 0:7fb6877b5d7c | 32 | #undef __AIX__ |
miruga27 | 0:7fb6877b5d7c | 33 | #define __AIX__ 1 |
miruga27 | 0:7fb6877b5d7c | 34 | #endif |
miruga27 | 0:7fb6877b5d7c | 35 | #if defined(__HAIKU__) |
miruga27 | 0:7fb6877b5d7c | 36 | #undef __HAIKU__ |
miruga27 | 0:7fb6877b5d7c | 37 | #define __HAIKU__ 1 |
miruga27 | 0:7fb6877b5d7c | 38 | #endif |
miruga27 | 0:7fb6877b5d7c | 39 | #if defined(bsdi) || defined(__bsdi) || defined(__bsdi__) |
miruga27 | 0:7fb6877b5d7c | 40 | #undef __BSDI__ |
miruga27 | 0:7fb6877b5d7c | 41 | #define __BSDI__ 1 |
miruga27 | 0:7fb6877b5d7c | 42 | #endif |
miruga27 | 0:7fb6877b5d7c | 43 | #if defined(_arch_dreamcast) |
miruga27 | 0:7fb6877b5d7c | 44 | #undef __DREAMCAST__ |
miruga27 | 0:7fb6877b5d7c | 45 | #define __DREAMCAST__ 1 |
miruga27 | 0:7fb6877b5d7c | 46 | #endif |
miruga27 | 0:7fb6877b5d7c | 47 | #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) |
miruga27 | 0:7fb6877b5d7c | 48 | #undef __FREEBSD__ |
miruga27 | 0:7fb6877b5d7c | 49 | #define __FREEBSD__ 1 |
miruga27 | 0:7fb6877b5d7c | 50 | #endif |
miruga27 | 0:7fb6877b5d7c | 51 | #if defined(hpux) || defined(__hpux) || defined(__hpux__) |
miruga27 | 0:7fb6877b5d7c | 52 | #undef __HPUX__ |
miruga27 | 0:7fb6877b5d7c | 53 | #define __HPUX__ 1 |
miruga27 | 0:7fb6877b5d7c | 54 | #endif |
miruga27 | 0:7fb6877b5d7c | 55 | #if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE) |
miruga27 | 0:7fb6877b5d7c | 56 | #undef __IRIX__ |
miruga27 | 0:7fb6877b5d7c | 57 | #define __IRIX__ 1 |
miruga27 | 0:7fb6877b5d7c | 58 | #endif |
miruga27 | 0:7fb6877b5d7c | 59 | #if defined(linux) || defined(__linux) || defined(__linux__) |
miruga27 | 0:7fb6877b5d7c | 60 | #undef __LINUX__ |
miruga27 | 0:7fb6877b5d7c | 61 | #define __LINUX__ 1 |
miruga27 | 0:7fb6877b5d7c | 62 | #endif |
miruga27 | 0:7fb6877b5d7c | 63 | #if defined(ANDROID) || defined(__ANDROID__) |
miruga27 | 0:7fb6877b5d7c | 64 | #undef __ANDROID__ |
miruga27 | 0:7fb6877b5d7c | 65 | #undef __LINUX__ /* do we need to do this? */ |
miruga27 | 0:7fb6877b5d7c | 66 | #define __ANDROID__ 1 |
miruga27 | 0:7fb6877b5d7c | 67 | #endif |
miruga27 | 0:7fb6877b5d7c | 68 | |
miruga27 | 0:7fb6877b5d7c | 69 | #if defined(__APPLE__) |
miruga27 | 0:7fb6877b5d7c | 70 | /* lets us know what version of Mac OS X we're compiling on */ |
miruga27 | 0:7fb6877b5d7c | 71 | #include "AvailabilityMacros.h" |
miruga27 | 0:7fb6877b5d7c | 72 | #include "TargetConditionals.h" |
miruga27 | 0:7fb6877b5d7c | 73 | #if TARGET_OS_IPHONE |
miruga27 | 0:7fb6877b5d7c | 74 | /* if compiling for iPhone */ |
miruga27 | 0:7fb6877b5d7c | 75 | #undef __IPHONEOS__ |
miruga27 | 0:7fb6877b5d7c | 76 | #define __IPHONEOS__ 1 |
miruga27 | 0:7fb6877b5d7c | 77 | #undef __MACOSX__ |
miruga27 | 0:7fb6877b5d7c | 78 | #else |
miruga27 | 0:7fb6877b5d7c | 79 | /* if not compiling for iPhone */ |
miruga27 | 0:7fb6877b5d7c | 80 | #undef __MACOSX__ |
miruga27 | 0:7fb6877b5d7c | 81 | #define __MACOSX__ 1 |
miruga27 | 0:7fb6877b5d7c | 82 | #if MAC_OS_X_VERSION_MIN_REQUIRED < 1050 |
miruga27 | 0:7fb6877b5d7c | 83 | # error SDL for Mac OS X only supports deploying on 10.5 and above. |
miruga27 | 0:7fb6877b5d7c | 84 | #endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1050 */ |
miruga27 | 0:7fb6877b5d7c | 85 | #endif /* TARGET_OS_IPHONE */ |
miruga27 | 0:7fb6877b5d7c | 86 | #endif /* defined(__APPLE__) */ |
miruga27 | 0:7fb6877b5d7c | 87 | |
miruga27 | 0:7fb6877b5d7c | 88 | #if defined(__NetBSD__) |
miruga27 | 0:7fb6877b5d7c | 89 | #undef __NETBSD__ |
miruga27 | 0:7fb6877b5d7c | 90 | #define __NETBSD__ 1 |
miruga27 | 0:7fb6877b5d7c | 91 | #endif |
miruga27 | 0:7fb6877b5d7c | 92 | #if defined(__OpenBSD__) |
miruga27 | 0:7fb6877b5d7c | 93 | #undef __OPENBSD__ |
miruga27 | 0:7fb6877b5d7c | 94 | #define __OPENBSD__ 1 |
miruga27 | 0:7fb6877b5d7c | 95 | #endif |
miruga27 | 0:7fb6877b5d7c | 96 | #if defined(__OS2__) |
miruga27 | 0:7fb6877b5d7c | 97 | #undef __OS2__ |
miruga27 | 0:7fb6877b5d7c | 98 | #define __OS2__ 1 |
miruga27 | 0:7fb6877b5d7c | 99 | #endif |
miruga27 | 0:7fb6877b5d7c | 100 | #if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE) |
miruga27 | 0:7fb6877b5d7c | 101 | #undef __OSF__ |
miruga27 | 0:7fb6877b5d7c | 102 | #define __OSF__ 1 |
miruga27 | 0:7fb6877b5d7c | 103 | #endif |
miruga27 | 0:7fb6877b5d7c | 104 | #if defined(__QNXNTO__) |
miruga27 | 0:7fb6877b5d7c | 105 | #undef __QNXNTO__ |
miruga27 | 0:7fb6877b5d7c | 106 | #define __QNXNTO__ 1 |
miruga27 | 0:7fb6877b5d7c | 107 | #endif |
miruga27 | 0:7fb6877b5d7c | 108 | #if defined(riscos) || defined(__riscos) || defined(__riscos__) |
miruga27 | 0:7fb6877b5d7c | 109 | #undef __RISCOS__ |
miruga27 | 0:7fb6877b5d7c | 110 | #define __RISCOS__ 1 |
miruga27 | 0:7fb6877b5d7c | 111 | #endif |
miruga27 | 0:7fb6877b5d7c | 112 | #if defined(__SVR4) |
miruga27 | 0:7fb6877b5d7c | 113 | #undef __SOLARIS__ |
miruga27 | 0:7fb6877b5d7c | 114 | #define __SOLARIS__ 1 |
miruga27 | 0:7fb6877b5d7c | 115 | #endif |
miruga27 | 0:7fb6877b5d7c | 116 | #if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) |
miruga27 | 0:7fb6877b5d7c | 117 | #undef __WINDOWS__ |
miruga27 | 0:7fb6877b5d7c | 118 | #define __WINDOWS__ 1 |
miruga27 | 0:7fb6877b5d7c | 119 | #endif |
miruga27 | 0:7fb6877b5d7c | 120 | #if defined(__WINDOWS__) |
miruga27 | 0:7fb6877b5d7c | 121 | #undef __WIN32__ |
miruga27 | 0:7fb6877b5d7c | 122 | #define __WIN32__ 1 |
miruga27 | 0:7fb6877b5d7c | 123 | #endif |
miruga27 | 0:7fb6877b5d7c | 124 | #if defined(__PSP__) |
miruga27 | 0:7fb6877b5d7c | 125 | #undef __PSP__ |
miruga27 | 0:7fb6877b5d7c | 126 | #define __PSP__ 1 |
miruga27 | 0:7fb6877b5d7c | 127 | #endif |
miruga27 | 0:7fb6877b5d7c | 128 | |
miruga27 | 0:7fb6877b5d7c | 129 | #include "begin_code.h" |
miruga27 | 0:7fb6877b5d7c | 130 | /* Set up for C function definitions, even when using C++ */ |
miruga27 | 0:7fb6877b5d7c | 131 | #ifdef __cplusplus |
miruga27 | 0:7fb6877b5d7c | 132 | extern "C" { |
miruga27 | 0:7fb6877b5d7c | 133 | #endif |
miruga27 | 0:7fb6877b5d7c | 134 | |
miruga27 | 0:7fb6877b5d7c | 135 | /** |
miruga27 | 0:7fb6877b5d7c | 136 | * \brief Gets the name of the platform. |
miruga27 | 0:7fb6877b5d7c | 137 | */ |
miruga27 | 0:7fb6877b5d7c | 138 | extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void); |
miruga27 | 0:7fb6877b5d7c | 139 | |
miruga27 | 0:7fb6877b5d7c | 140 | /* Ends C function definitions when using C++ */ |
miruga27 | 0:7fb6877b5d7c | 141 | #ifdef __cplusplus |
miruga27 | 0:7fb6877b5d7c | 142 | } |
miruga27 | 0:7fb6877b5d7c | 143 | #endif |
miruga27 | 0:7fb6877b5d7c | 144 | #include "close_code.h" |
miruga27 | 0:7fb6877b5d7c | 145 | |
miruga27 | 0:7fb6877b5d7c | 146 | #endif /* _SDL_platform_h */ |
miruga27 | 0:7fb6877b5d7c | 147 | |
miruga27 | 0:7fb6877b5d7c | 148 | /* vi: set ts=4 sw=4 expandtab: */ |