include/SDL_platform.h
author Sam Lantinga <slouken@libsdl.org>
Fri, 08 Apr 2011 13:03:26 -0700
changeset 5535 96594ac5fd1a
parent 5262 b530ef003506
child 5646 fe1df351ca3d
permissions -rw-r--r--
SDL 1.3 is now under the zlib license.
slouken@1402
     1
/*
slouken@5535
     2
  Simple DirectMedia Layer
slouken@5535
     3
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
slouken@1402
     4
slouken@5535
     5
  This software is provided 'as-is', without any express or implied
slouken@5535
     6
  warranty.  In no event will the authors be held liable for any damages
slouken@5535
     7
  arising from the use of this software.
slouken@1402
     8
slouken@5535
     9
  Permission is granted to anyone to use this software for any purpose,
slouken@5535
    10
  including commercial applications, and to alter it and redistribute it
slouken@5535
    11
  freely, subject to the following restrictions:
slouken@1402
    12
slouken@5535
    13
  1. The origin of this software must not be misrepresented; you must not
slouken@5535
    14
     claim that you wrote the original software. If you use this software
slouken@5535
    15
     in a product, an acknowledgment in the product documentation would be
slouken@5535
    16
     appreciated but is not required.
slouken@5535
    17
  2. Altered source versions must be plainly marked as such, and must not be
slouken@5535
    18
     misrepresented as being the original software.
slouken@5535
    19
  3. This notice may not be removed or altered from any source distribution.
slouken@1402
    20
*/
slouken@1402
    21
slouken@3407
    22
/**
slouken@3407
    23
 *  \file SDL_platform.h
slouken@3407
    24
 *  
slouken@3407
    25
 *  Try to get a standard set of platform defines.
slouken@3407
    26
 */
slouken@1402
    27
slouken@1406
    28
#ifndef _SDL_platform_h
slouken@1406
    29
#define _SDL_platform_h
slouken@1406
    30
slouken@1402
    31
#if defined(_AIX)
slouken@1402
    32
#undef __AIX__
slouken@1402
    33
#define __AIX__		1
slouken@1402
    34
#endif
slouken@1402
    35
#if defined(__BEOS__)
slouken@1402
    36
#undef __BEOS__
slouken@1402
    37
#define __BEOS__	1
slouken@1402
    38
#endif
slouken@3292
    39
#if defined(__HAIKU__)
slouken@3292
    40
#undef __HAIKU__
slouken@3292
    41
#define __HAIKU__	1
slouken@3292
    42
#endif
slouken@1402
    43
#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__)
slouken@1402
    44
#undef __BSDI__
slouken@1402
    45
#define __BSDI__	1
slouken@1402
    46
#endif
slouken@1461
    47
#if defined(_arch_dreamcast)
slouken@1402
    48
#undef __DREAMCAST__
slouken@1402
    49
#define __DREAMCAST__	1
slouken@1402
    50
#endif
slouken@3366
    51
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
slouken@1402
    52
#undef __FREEBSD__
slouken@1402
    53
#define __FREEBSD__	1
slouken@1402
    54
#endif
slouken@1402
    55
#if defined(hpux) || defined(__hpux) || defined(__hpux__)
slouken@1402
    56
#undef __HPUX__
slouken@1402
    57
#define __HPUX__	1
slouken@1402
    58
#endif
slouken@1402
    59
#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE)
slouken@1402
    60
#undef __IRIX__
slouken@1402
    61
#define __IRIX__	1
slouken@1402
    62
#endif
slouken@1402
    63
#if defined(linux) || defined(__linux) || defined(__linux__)
slouken@1402
    64
#undef __LINUX__
slouken@1402
    65
#define __LINUX__	1
slouken@1402
    66
#endif
paul@4695
    67
#if defined(ANDROID)
paul@4695
    68
#undef __ANDROID__
paul@4696
    69
#undef __LINUX__ /*do we need to do this?*/
paul@4695
    70
#define __ANDROID__ 1
paul@4695
    71
#endif
paul@4695
    72
slouken@1631
    73
#if defined(__APPLE__)
slouken@2765
    74
/* lets us know what version of Mac OS X we're compiling on */
slouken@2765
    75
#include "AvailabilityMacros.h"
slouken@4925
    76
#include "TargetConditionals.h"
slouken@4925
    77
#ifndef MAC_OS_X_VERSION_10_4
slouken@4925
    78
#define MAC_OS_X_VERSION_10_4 1040
slouken@4925
    79
#endif
slouken@4925
    80
#ifndef MAC_OS_X_VERSION_10_5
slouken@4925
    81
#define MAC_OS_X_VERSION_10_5 1050
slouken@4925
    82
#endif
slouken@4925
    83
#ifndef MAC_OS_X_VERSION_10_6
slouken@4925
    84
#define MAC_OS_X_VERSION_10_6 1060
slouken@4925
    85
#endif
slouken@2765
    86
#if TARGET_OS_IPHONE
slouken@2765
    87
/* if compiling for iPhone */
slouken@2765
    88
#undef __IPHONEOS__
slouken@2765
    89
#define __IPHONEOS__ 1
slouken@2765
    90
#undef __MACOSX__
slouken@2765
    91
#else
slouken@2765
    92
/* if not compiling for iPhone */
slouken@1402
    93
#undef __MACOSX__
slouken@1402
    94
#define __MACOSX__	1
slouken@2765
    95
#endif /* TARGET_OS_IPHONE */
slouken@2765
    96
#endif /* defined(__APPLE__) */
slouken@2765
    97
slouken@1402
    98
#if defined(__NetBSD__)
slouken@1402
    99
#undef __NETBSD__
slouken@1402
   100
#define __NETBSD__	1
slouken@1402
   101
#endif
slouken@1402
   102
#if defined(__OpenBSD__)
slouken@1402
   103
#undef __OPENBSD__
slouken@1402
   104
#define __OPENBSD__	1
slouken@1402
   105
#endif
slouken@1402
   106
#if defined(__OS2__)
slouken@1402
   107
#undef __OS2__
slouken@1402
   108
#define __OS2__		1
slouken@1402
   109
#endif
slouken@1402
   110
#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE)
slouken@1402
   111
#undef __OSF__
slouken@1402
   112
#define __OSF__		1
slouken@1402
   113
#endif
slouken@1402
   114
#if defined(__QNXNTO__)
slouken@1402
   115
#undef __QNXNTO__
slouken@1402
   116
#define __QNXNTO__	1
slouken@1402
   117
#endif
slouken@1402
   118
#if defined(riscos) || defined(__riscos) || defined(__riscos__)
slouken@1402
   119
#undef __RISCOS__
slouken@1402
   120
#define __RISCOS__	1
slouken@1402
   121
#endif
slouken@1631
   122
#if defined(__SVR4)
slouken@1402
   123
#undef __SOLARIS__
slouken@1402
   124
#define __SOLARIS__	1
slouken@1402
   125
#endif
slouken@1402
   126
#if defined(WIN32) || defined(_WIN32)
slouken@5086
   127
#undef __WIN32__
slouken@5086
   128
#define __WIN32__	1
slouken@1402
   129
#endif
slouken@1406
   130
slouken@2735
   131
#if defined(__NDS__)
slouken@2735
   132
#undef __NINTENDODS__
slouken@2735
   133
#define __NINTENDODS__	1
slouken@2735
   134
#endif
slouken@2735
   135
slouken@3319
   136
slouken@3319
   137
#include "begin_code.h"
slouken@3319
   138
/* Set up for C function definitions, even when using C++ */
slouken@3319
   139
#ifdef __cplusplus
slouken@3319
   140
/* *INDENT-OFF* */
slouken@3319
   141
extern "C" {
slouken@3319
   142
/* *INDENT-ON* */
slouken@3319
   143
#endif
slouken@3319
   144
slouken@3319
   145
/**
slouken@3407
   146
 *  \brief Gets the name of the platform.
slouken@3319
   147
 */
slouken@3319
   148
extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void);
slouken@3319
   149
slouken@3319
   150
/* Ends C function definitions when using C++ */
slouken@3319
   151
#ifdef __cplusplus
slouken@3319
   152
/* *INDENT-OFF* */
slouken@3319
   153
}
slouken@3319
   154
/* *INDENT-ON* */
slouken@3319
   155
#endif
slouken@3319
   156
#include "close_code.h"
slouken@3319
   157
slouken@1406
   158
#endif /* _SDL_platform_h */
slouken@3319
   159
slouken@3319
   160
/* vi: set ts=4 sw=4 expandtab: */