include/SDL_platform.h
author David Ludwig <dludwig@pobox.com>
Sun, 27 Oct 2013 21:26:46 -0400
changeset 8535 e8ee0708ef5c
parent 8478 337b5dc0797b
parent 7856 cb37776926ad
child 8543 b9dd3cf38585
permissions -rw-r--r--
WinRT: merged with SDL 2.0.1 codebase
dludwig@8535
     1
/*
dludwig@8535
     2
  Simple DirectMedia Layer
dludwig@8535
     3
  Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
dludwig@8535
     4
dludwig@8535
     5
  This software is provided 'as-is', without any express or implied
dludwig@8535
     6
  warranty.  In no event will the authors be held liable for any damages
dludwig@8535
     7
  arising from the use of this software.
dludwig@8535
     8
dludwig@8535
     9
  Permission is granted to anyone to use this software for any purpose,
dludwig@8535
    10
  including commercial applications, and to alter it and redistribute it
dludwig@8535
    11
  freely, subject to the following restrictions:
dludwig@8535
    12
dludwig@8535
    13
  1. The origin of this software must not be misrepresented; you must not
dludwig@8535
    14
     claim that you wrote the original software. If you use this software
dludwig@8535
    15
     in a product, an acknowledgment in the product documentation would be
dludwig@8535
    16
     appreciated but is not required.
dludwig@8535
    17
  2. Altered source versions must be plainly marked as such, and must not be
dludwig@8535
    18
     misrepresented as being the original software.
dludwig@8535
    19
  3. This notice may not be removed or altered from any source distribution.
dludwig@8535
    20
*/
dludwig@8535
    21
dludwig@8535
    22
/**
dludwig@8535
    23
 *  \file SDL_platform.h
dludwig@8535
    24
 *
dludwig@8535
    25
 *  Try to get a standard set of platform defines.
dludwig@8535
    26
 */
dludwig@8535
    27
dludwig@8535
    28
#ifndef _SDL_platform_h
dludwig@8535
    29
#define _SDL_platform_h
dludwig@8535
    30
dludwig@8535
    31
#if defined(_AIX)
dludwig@8535
    32
#undef __AIX__
dludwig@8535
    33
#define __AIX__     1
dludwig@8535
    34
#endif
dludwig@8535
    35
#if defined(__BEOS__)
dludwig@8535
    36
#undef __BEOS__
dludwig@8535
    37
#define __BEOS__    1
dludwig@8535
    38
#endif
dludwig@8535
    39
#if defined(__HAIKU__)
dludwig@8535
    40
#undef __HAIKU__
dludwig@8535
    41
#define __HAIKU__   1
dludwig@8535
    42
#endif
dludwig@8535
    43
#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__)
dludwig@8535
    44
#undef __BSDI__
dludwig@8535
    45
#define __BSDI__    1
dludwig@8535
    46
#endif
dludwig@8535
    47
#if defined(_arch_dreamcast)
dludwig@8535
    48
#undef __DREAMCAST__
dludwig@8535
    49
#define __DREAMCAST__   1
dludwig@8535
    50
#endif
dludwig@8535
    51
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
dludwig@8535
    52
#undef __FREEBSD__
dludwig@8535
    53
#define __FREEBSD__ 1
dludwig@8535
    54
#endif
dludwig@8535
    55
#if defined(hpux) || defined(__hpux) || defined(__hpux__)
dludwig@8535
    56
#undef __HPUX__
dludwig@8535
    57
#define __HPUX__    1
dludwig@8535
    58
#endif
dludwig@8535
    59
#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE)
dludwig@8535
    60
#undef __IRIX__
dludwig@8535
    61
#define __IRIX__    1
dludwig@8535
    62
#endif
dludwig@8535
    63
#if defined(linux) || defined(__linux) || defined(__linux__)
dludwig@8535
    64
#undef __LINUX__
dludwig@8535
    65
#define __LINUX__   1
dludwig@8535
    66
#endif
dludwig@8535
    67
#if defined(ANDROID)
dludwig@8535
    68
#undef __ANDROID__
dludwig@8535
    69
#undef __LINUX__ /* do we need to do this? */
dludwig@8535
    70
#define __ANDROID__ 1
dludwig@8535
    71
#endif
dludwig@8535
    72
dludwig@8535
    73
#if defined(__APPLE__)
dludwig@8535
    74
/* lets us know what version of Mac OS X we're compiling on */
dludwig@8535
    75
#include "AvailabilityMacros.h"
dludwig@8535
    76
#include "TargetConditionals.h"
dludwig@8535
    77
#if TARGET_OS_IPHONE
dludwig@8535
    78
/* if compiling for iPhone */
dludwig@8535
    79
#undef __IPHONEOS__
dludwig@8535
    80
#define __IPHONEOS__ 1
dludwig@8535
    81
#undef __MACOSX__
dludwig@8535
    82
#else
dludwig@8535
    83
/* if not compiling for iPhone */
dludwig@8535
    84
#undef __MACOSX__
dludwig@8535
    85
#define __MACOSX__  1
dludwig@8535
    86
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050
dludwig@8535
    87
# error SDL for Mac OS X only supports deploying on 10.5 and above.
dludwig@8535
    88
#endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1050 */
dludwig@8535
    89
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
dludwig@8535
    90
# error SDL for Mac OS X must be built with a 10.6 SDK or above.
dludwig@8535
    91
#endif /* MAC_OS_X_VERSION_MAX_ALLOWED < 1060 */
dludwig@8535
    92
#endif /* TARGET_OS_IPHONE */
dludwig@8535
    93
#endif /* defined(__APPLE__) */
dludwig@8535
    94
dludwig@8535
    95
#if defined(__NetBSD__)
dludwig@8535
    96
#undef __NETBSD__
dludwig@8535
    97
#define __NETBSD__  1
dludwig@8535
    98
#endif
dludwig@8535
    99
#if defined(__OpenBSD__)
dludwig@8535
   100
#undef __OPENBSD__
dludwig@8535
   101
#define __OPENBSD__ 1
dludwig@8535
   102
#endif
dludwig@8535
   103
#if defined(__OS2__)
dludwig@8535
   104
#undef __OS2__
dludwig@8535
   105
#define __OS2__     1
dludwig@8535
   106
#endif
dludwig@8535
   107
#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE)
dludwig@8535
   108
#undef __OSF__
dludwig@8535
   109
#define __OSF__     1
dludwig@8535
   110
#endif
dludwig@8535
   111
#if defined(__QNXNTO__)
dludwig@8535
   112
#undef __QNXNTO__
dludwig@8535
   113
#define __QNXNTO__  1
dludwig@8535
   114
#endif
dludwig@8535
   115
#if defined(riscos) || defined(__riscos) || defined(__riscos__)
dludwig@8535
   116
#undef __RISCOS__
dludwig@8535
   117
#define __RISCOS__  1
dludwig@8535
   118
#endif
dludwig@8535
   119
#if defined(__SVR4)
dludwig@8535
   120
#undef __SOLARIS__
dludwig@8535
   121
#define __SOLARIS__ 1
dludwig@8535
   122
#endif
dludwig@8535
   123
dludwig@8478
   124
#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__)
dludwig@8535
   125
/* Try to find out if we're compiling for WinRT or non-WinRT */
dludwig@8478
   126
#if defined(_MSC_VER) && (_MSC_VER >= 1700)	/* _MSC_VER==1700 for MSVC 2012 */
dludwig@8478
   127
#include <winapifamily.h>
dludwig@8535
   128
#endif /* _MSC_VER >= 1700 */
dludwig@8535
   129
/* Default to classic, Win32/Win64/Desktop compilation either if:
dludwig@8478
   130
     1. the version of Windows is explicity set to a 'Desktop' (non-Metro) app
dludwig@8478
   131
     2. the version of Windows cannot be determined via winapifamily.h
dludwig@8535
   132
   If neither is true, then see if we're compiling for WinRT.
dludwig@8478
   133
 */
dludwig@8478
   134
#if ! defined(WINAPI_FAMILY_PARTITION) || WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
dludwig@8535
   135
#undef __WINDOWS__
dludwig@8535
   136
#define __WINDOWS__   1
dludwig@8478
   137
/* See if we're compiling for WinRT: */
dludwig@8478
   138
#elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
dludwig@8478
   139
#undef __WINRT__
dludwig@8478
   140
#define __WINRT__ 1
dludwig@8478
   141
#endif /* ! defined(WINAPI_FAMILY_PARTITION) */
dludwig@8535
   142
#endif /* defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) */
dludwig@8535
   143
dludwig@8535
   144
#if defined(__WINDOWS__)
dludwig@8535
   145
#undef __WIN32__
dludwig@8535
   146
#define __WIN32__ 1
dludwig@8535
   147
#endif
dludwig@8535
   148
#if defined(__PSP__)
dludwig@8535
   149
#undef __PSP__
dludwig@8535
   150
#define __PSP__ 1
dludwig@8535
   151
#endif
dludwig@8535
   152
dludwig@8535
   153
#include "begin_code.h"
dludwig@8535
   154
/* Set up for C function definitions, even when using C++ */
dludwig@8535
   155
#ifdef __cplusplus
dludwig@8535
   156
extern "C" {
dludwig@8535
   157
#endif
dludwig@8535
   158
dludwig@8535
   159
/**
dludwig@8535
   160
 *  \brief Gets the name of the platform.
dludwig@8535
   161
 */
dludwig@8535
   162
extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void);
dludwig@8535
   163
dludwig@8535
   164
/* Ends C function definitions when using C++ */
dludwig@8535
   165
#ifdef __cplusplus
dludwig@8535
   166
}
dludwig@8535
   167
#endif
dludwig@8535
   168
#include "close_code.h"
dludwig@8535
   169
dludwig@8535
   170
#endif /* _SDL_platform_h */
dludwig@8535
   171
dludwig@8535
   172
/* vi: set ts=4 sw=4 expandtab: */