include/SDL_platform.h
author David Ludwig <dludwig@pobox.com>
Wed, 17 Oct 2012 21:43:20 -0400
changeset 8316 88f011703f39
parent 6138 4c64952a58fb
child 8352 deef25f5fce1
permissions -rw-r--r--
Got a bare-bones version of SDL compiling for Windows RT. Dummy drivers are used in some places. Very little Windows-specific code (from the Win32 version of SDL) is used.
slouken@1402
     1
/*
slouken@5535
     2
  Simple DirectMedia Layer
slouken@6138
     3
  Copyright (C) 1997-2012 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@2765
    77
#if TARGET_OS_IPHONE
slouken@2765
    78
/* if compiling for iPhone */
slouken@2765
    79
#undef __IPHONEOS__
slouken@2765
    80
#define __IPHONEOS__ 1
slouken@2765
    81
#undef __MACOSX__
slouken@2765
    82
#else
slouken@2765
    83
/* if not compiling for iPhone */
slouken@1402
    84
#undef __MACOSX__
slouken@1402
    85
#define __MACOSX__	1
slouken@2765
    86
#endif /* TARGET_OS_IPHONE */
slouken@2765
    87
#endif /* defined(__APPLE__) */
slouken@2765
    88
slouken@1402
    89
#if defined(__NetBSD__)
slouken@1402
    90
#undef __NETBSD__
slouken@1402
    91
#define __NETBSD__	1
slouken@1402
    92
#endif
slouken@1402
    93
#if defined(__OpenBSD__)
slouken@1402
    94
#undef __OPENBSD__
slouken@1402
    95
#define __OPENBSD__	1
slouken@1402
    96
#endif
slouken@1402
    97
#if defined(__OS2__)
slouken@1402
    98
#undef __OS2__
slouken@1402
    99
#define __OS2__		1
slouken@1402
   100
#endif
slouken@1402
   101
#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE)
slouken@1402
   102
#undef __OSF__
slouken@1402
   103
#define __OSF__		1
slouken@1402
   104
#endif
slouken@1402
   105
#if defined(__QNXNTO__)
slouken@1402
   106
#undef __QNXNTO__
slouken@1402
   107
#define __QNXNTO__	1
slouken@1402
   108
#endif
slouken@1402
   109
#if defined(riscos) || defined(__riscos) || defined(__riscos__)
slouken@1402
   110
#undef __RISCOS__
slouken@1402
   111
#define __RISCOS__	1
slouken@1402
   112
#endif
slouken@1631
   113
#if defined(__SVR4)
slouken@1402
   114
#undef __SOLARIS__
slouken@1402
   115
#define __SOLARIS__	1
slouken@1402
   116
#endif
slouken@1402
   117
#if defined(WIN32) || defined(_WIN32)
dludwig@8316
   118
#if ! defined(__WINRT__)
slouken@5086
   119
#undef __WIN32__
slouken@5086
   120
#define __WIN32__	1
slouken@1402
   121
#endif
dludwig@8316
   122
#endif
slouken@1406
   123
slouken@2735
   124
#if defined(__NDS__)
slouken@2735
   125
#undef __NINTENDODS__
slouken@2735
   126
#define __NINTENDODS__	1
slouken@2735
   127
#endif
slouken@2735
   128
slouken@3319
   129
slouken@3319
   130
#include "begin_code.h"
slouken@3319
   131
/* Set up for C function definitions, even when using C++ */
slouken@3319
   132
#ifdef __cplusplus
slouken@3319
   133
/* *INDENT-OFF* */
slouken@3319
   134
extern "C" {
slouken@3319
   135
/* *INDENT-ON* */
slouken@3319
   136
#endif
slouken@3319
   137
slouken@3319
   138
/**
slouken@3407
   139
 *  \brief Gets the name of the platform.
slouken@3319
   140
 */
slouken@3319
   141
extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void);
slouken@3319
   142
slouken@3319
   143
/* Ends C function definitions when using C++ */
slouken@3319
   144
#ifdef __cplusplus
slouken@3319
   145
/* *INDENT-OFF* */
slouken@3319
   146
}
slouken@3319
   147
/* *INDENT-ON* */
slouken@3319
   148
#endif
slouken@3319
   149
#include "close_code.h"
slouken@3319
   150
slouken@1406
   151
#endif /* _SDL_platform_h */
slouken@3319
   152
slouken@3319
   153
/* vi: set ts=4 sw=4 expandtab: */