SDL Library

Dependents:   H261_decoder

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SDL_platform.h Source File

SDL_platform.h

Go to the documentation of this file.
00001 /*
00002   Simple DirectMedia Layer
00003   Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
00004 
00005   This software is provided 'as-is', without any express or implied
00006   warranty.  In no event will the authors be held liable for any damages
00007   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
00011   freely, subject to the following restrictions:
00012 
00013   1. The origin of this software must not be misrepresented; you must not
00014      claim that you wrote the original software. If you use this software
00015      in a product, an acknowledgment in the product documentation would be
00016      appreciated but is not required.
00017   2. Altered source versions must be plainly marked as such, and must not be
00018      misrepresented as being the original software.
00019   3. This notice may not be removed or altered from any source distribution.
00020 */
00021 
00022 /**
00023  *  \file SDL_platform.h
00024  *
00025  *  Try to get a standard set of platform defines.
00026  */
00027 
00028 #ifndef _SDL_platform_h
00029 #define _SDL_platform_h
00030 
00031 #if defined(_AIX)
00032 #undef __AIX__
00033 #define __AIX__     1
00034 #endif
00035 #if defined(__HAIKU__)
00036 #undef __HAIKU__
00037 #define __HAIKU__   1
00038 #endif
00039 #if defined(bsdi) || defined(__bsdi) || defined(__bsdi__)
00040 #undef __BSDI__
00041 #define __BSDI__    1
00042 #endif
00043 #if defined(_arch_dreamcast)
00044 #undef __DREAMCAST__
00045 #define __DREAMCAST__   1
00046 #endif
00047 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
00048 #undef __FREEBSD__
00049 #define __FREEBSD__ 1
00050 #endif
00051 #if defined(hpux) || defined(__hpux) || defined(__hpux__)
00052 #undef __HPUX__
00053 #define __HPUX__    1
00054 #endif
00055 #if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE)
00056 #undef __IRIX__
00057 #define __IRIX__    1
00058 #endif
00059 #if defined(linux) || defined(__linux) || defined(__linux__)
00060 #undef __LINUX__
00061 #define __LINUX__   1
00062 #endif
00063 #if defined(ANDROID) || defined(__ANDROID__)
00064 #undef __ANDROID__
00065 #undef __LINUX__ /* do we need to do this? */
00066 #define __ANDROID__ 1
00067 #endif
00068 
00069 #if defined(__APPLE__)
00070 /* lets us know what version of Mac OS X we're compiling on */
00071 #include "AvailabilityMacros.h"
00072 #include "TargetConditionals.h"
00073 #if TARGET_OS_IPHONE
00074 /* if compiling for iPhone */
00075 #undef __IPHONEOS__
00076 #define __IPHONEOS__ 1
00077 #undef __MACOSX__
00078 #else
00079 /* if not compiling for iPhone */
00080 #undef __MACOSX__
00081 #define __MACOSX__  1
00082 #if MAC_OS_X_VERSION_MIN_REQUIRED < 1050
00083 # error SDL for Mac OS X only supports deploying on 10.5 and above.
00084 #endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1050 */
00085 #endif /* TARGET_OS_IPHONE */
00086 #endif /* defined(__APPLE__) */
00087 
00088 #if defined(__NetBSD__)
00089 #undef __NETBSD__
00090 #define __NETBSD__  1
00091 #endif
00092 #if defined(__OpenBSD__)
00093 #undef __OPENBSD__
00094 #define __OPENBSD__ 1
00095 #endif
00096 #if defined(__OS2__)
00097 #undef __OS2__
00098 #define __OS2__     1
00099 #endif
00100 #if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE)
00101 #undef __OSF__
00102 #define __OSF__     1
00103 #endif
00104 #if defined(__QNXNTO__)
00105 #undef __QNXNTO__
00106 #define __QNXNTO__  1
00107 #endif
00108 #if defined(riscos) || defined(__riscos) || defined(__riscos__)
00109 #undef __RISCOS__
00110 #define __RISCOS__  1
00111 #endif
00112 #if defined(__SVR4)
00113 #undef __SOLARIS__
00114 #define __SOLARIS__ 1
00115 #endif
00116 #if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__)
00117 #undef __WINDOWS__
00118 #define __WINDOWS__   1
00119 #endif
00120 #if defined(__WINDOWS__)
00121 #undef __WIN32__
00122 #define __WIN32__ 1
00123 #endif
00124 #if defined(__PSP__)
00125 #undef __PSP__
00126 #define __PSP__ 1
00127 #endif
00128 
00129 #include "begin_code.h"
00130 /* Set up for C function definitions, even when using C++ */
00131 #ifdef __cplusplus
00132 extern "C" {
00133 #endif
00134 
00135 /**
00136  *  \brief Gets the name of the platform.
00137  */
00138 extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void);
00139 
00140 /* Ends C function definitions when using C++ */
00141 #ifdef __cplusplus
00142 }
00143 #endif
00144 #include "close_code.h"
00145 
00146 #endif /* _SDL_platform_h */
00147 
00148 /* vi: set ts=4 sw=4 expandtab: */