include/SDL_platform.h
author Sam Lantinga <slouken@libsdl.org>
Fri, 11 Feb 2011 22:37:15 -0800
changeset 5262 b530ef003506
parent 5086 c2539ff054c8
child 5535 96594ac5fd1a
permissions -rw-r--r--
Happy 2011! :)
     1 /*
     2     SDL - Simple DirectMedia Layer
     3     Copyright (C) 1997-2011 Sam Lantinga
     4 
     5     This library is free software; you can redistribute it and/or
     6     modify it under the terms of the GNU Lesser General Public
     7     License as published by the Free Software Foundation; either
     8     version 2.1 of the License, or (at your option) any later version.
     9 
    10     This library is distributed in the hope that it will be useful,
    11     but WITHOUT ANY WARRANTY; without even the implied warranty of
    12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    13     Lesser General Public License for more details.
    14 
    15     You should have received a copy of the GNU Lesser General Public
    16     License along with this library; if not, write to the Free Software
    17     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    18 
    19     Sam Lantinga
    20     slouken@libsdl.org
    21 */
    22 
    23 /**
    24  *  \file SDL_platform.h
    25  *  
    26  *  Try to get a standard set of platform defines.
    27  */
    28 
    29 #ifndef _SDL_platform_h
    30 #define _SDL_platform_h
    31 
    32 #if defined(_AIX)
    33 #undef __AIX__
    34 #define __AIX__		1
    35 #endif
    36 #if defined(__BEOS__)
    37 #undef __BEOS__
    38 #define __BEOS__	1
    39 #endif
    40 #if defined(__HAIKU__)
    41 #undef __HAIKU__
    42 #define __HAIKU__	1
    43 #endif
    44 #if defined(bsdi) || defined(__bsdi) || defined(__bsdi__)
    45 #undef __BSDI__
    46 #define __BSDI__	1
    47 #endif
    48 #if defined(_arch_dreamcast)
    49 #undef __DREAMCAST__
    50 #define __DREAMCAST__	1
    51 #endif
    52 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
    53 #undef __FREEBSD__
    54 #define __FREEBSD__	1
    55 #endif
    56 #if defined(hpux) || defined(__hpux) || defined(__hpux__)
    57 #undef __HPUX__
    58 #define __HPUX__	1
    59 #endif
    60 #if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE)
    61 #undef __IRIX__
    62 #define __IRIX__	1
    63 #endif
    64 #if defined(linux) || defined(__linux) || defined(__linux__)
    65 #undef __LINUX__
    66 #define __LINUX__	1
    67 #endif
    68 #if defined(ANDROID)
    69 #undef __ANDROID__
    70 #undef __LINUX__ /*do we need to do this?*/
    71 #define __ANDROID__ 1
    72 #endif
    73 
    74 #if defined(__APPLE__)
    75 /* lets us know what version of Mac OS X we're compiling on */
    76 #include "AvailabilityMacros.h"
    77 #include "TargetConditionals.h"
    78 #ifndef MAC_OS_X_VERSION_10_4
    79 #define MAC_OS_X_VERSION_10_4 1040
    80 #endif
    81 #ifndef MAC_OS_X_VERSION_10_5
    82 #define MAC_OS_X_VERSION_10_5 1050
    83 #endif
    84 #ifndef MAC_OS_X_VERSION_10_6
    85 #define MAC_OS_X_VERSION_10_6 1060
    86 #endif
    87 #if TARGET_OS_IPHONE
    88 /* if compiling for iPhone */
    89 #undef __IPHONEOS__
    90 #define __IPHONEOS__ 1
    91 #undef __MACOSX__
    92 #else
    93 /* if not compiling for iPhone */
    94 #undef __MACOSX__
    95 #define __MACOSX__	1
    96 #endif /* TARGET_OS_IPHONE */
    97 #endif /* defined(__APPLE__) */
    98 
    99 #if defined(__NetBSD__)
   100 #undef __NETBSD__
   101 #define __NETBSD__	1
   102 #endif
   103 #if defined(__OpenBSD__)
   104 #undef __OPENBSD__
   105 #define __OPENBSD__	1
   106 #endif
   107 #if defined(__OS2__)
   108 #undef __OS2__
   109 #define __OS2__		1
   110 #endif
   111 #if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE)
   112 #undef __OSF__
   113 #define __OSF__		1
   114 #endif
   115 #if defined(__QNXNTO__)
   116 #undef __QNXNTO__
   117 #define __QNXNTO__	1
   118 #endif
   119 #if defined(riscos) || defined(__riscos) || defined(__riscos__)
   120 #undef __RISCOS__
   121 #define __RISCOS__	1
   122 #endif
   123 #if defined(__SVR4)
   124 #undef __SOLARIS__
   125 #define __SOLARIS__	1
   126 #endif
   127 #if defined(WIN32) || defined(_WIN32)
   128 #undef __WIN32__
   129 #define __WIN32__	1
   130 #endif
   131 
   132 #if defined(__NDS__)
   133 #undef __NINTENDODS__
   134 #define __NINTENDODS__	1
   135 #endif
   136 
   137 
   138 #include "begin_code.h"
   139 /* Set up for C function definitions, even when using C++ */
   140 #ifdef __cplusplus
   141 /* *INDENT-OFF* */
   142 extern "C" {
   143 /* *INDENT-ON* */
   144 #endif
   145 
   146 /**
   147  *  \brief Gets the name of the platform.
   148  */
   149 extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void);
   150 
   151 /* Ends C function definitions when using C++ */
   152 #ifdef __cplusplus
   153 /* *INDENT-OFF* */
   154 }
   155 /* *INDENT-ON* */
   156 #endif
   157 #include "close_code.h"
   158 
   159 #endif /* _SDL_platform_h */
   160 
   161 /* vi: set ts=4 sw=4 expandtab: */