include/SDL_platform.h
author Paul Hunkin <paul@bieh.net>
Sun, 23 May 2010 15:08:30 +1200
changeset 4696 3a3e8fb1b6f4
parent 4695 b7918263da92
child 4925 514f811a4887
permissions -rw-r--r--
Fixed comment style
     1 /*
     2     SDL - Simple DirectMedia Layer
     3     Copyright (C) 1997-2010 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 #ifdef MAC_OS_X_VERSION_10_3
    78 #include "TargetConditionals.h" /* this header is in 10.3 or later */
    79 #if TARGET_OS_IPHONE
    80 /* if compiling for iPhone */
    81 #undef __IPHONEOS__
    82 #define __IPHONEOS__ 1
    83 #undef __MACOSX__
    84 #else
    85 /* if not compiling for iPhone */
    86 #undef __MACOSX__
    87 #define __MACOSX__	1
    88 #endif /* TARGET_OS_IPHONE */
    89 #else
    90 /* if earlier verion of Mac OS X than version 10.3 */
    91 #undef __MACOSX__
    92 #define __MACOSX__	1
    93 #endif
    94 
    95 #endif /* defined(__APPLE__) */
    96 
    97 #if defined(__NetBSD__)
    98 #undef __NETBSD__
    99 #define __NETBSD__	1
   100 #endif
   101 #if defined(__OpenBSD__)
   102 #undef __OPENBSD__
   103 #define __OPENBSD__	1
   104 #endif
   105 #if defined(__OS2__)
   106 #undef __OS2__
   107 #define __OS2__		1
   108 #endif
   109 #if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE)
   110 #undef __OSF__
   111 #define __OSF__		1
   112 #endif
   113 #if defined(__QNXNTO__)
   114 #undef __QNXNTO__
   115 #define __QNXNTO__	1
   116 #endif
   117 #if defined(riscos) || defined(__riscos) || defined(__riscos__)
   118 #undef __RISCOS__
   119 #define __RISCOS__	1
   120 #endif
   121 #if defined(__SVR4)
   122 #undef __SOLARIS__
   123 #define __SOLARIS__	1
   124 #endif
   125 #if defined(WIN32) || defined(_WIN32)
   126 #undef __WIN32__
   127 #define __WIN32__	1
   128 #endif
   129 
   130 #if defined(__NDS__)
   131 #undef __NINTENDODS__
   132 #define __NINTENDODS__	1
   133 #endif
   134 
   135 
   136 #include "begin_code.h"
   137 /* Set up for C function definitions, even when using C++ */
   138 #ifdef __cplusplus
   139 /* *INDENT-OFF* */
   140 extern "C" {
   141 /* *INDENT-ON* */
   142 #endif
   143 
   144 /**
   145  *  \brief Gets the name of the platform.
   146  */
   147 extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void);
   148 
   149 /* Ends C function definitions when using C++ */
   150 #ifdef __cplusplus
   151 /* *INDENT-OFF* */
   152 }
   153 /* *INDENT-ON* */
   154 #endif
   155 #include "close_code.h"
   156 
   157 #endif /* _SDL_platform_h */
   158 
   159 /* vi: set ts=4 sw=4 expandtab: */