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