include/SDL_platform.h
author Sam Lantinga <slouken@libsdl.org>
Tue, 21 Feb 2006 08:46:50 +0000
changeset 1402 d910939febfa
child 1406 39ca9a4b22f3
permissions -rw-r--r--
Use consistent identifiers for the various platforms we support.
Make sure every source file includes SDL_config.h, so the proper system
headers are chosen.
slouken@1402
     1
/*
slouken@1402
     2
    SDL - Simple DirectMedia Layer
slouken@1402
     3
    Copyright (C) 1997-2006 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@1402
    23
/* Try to get a standard set of platform defines */
slouken@1402
    24
slouken@1402
    25
#if defined(_AIX)
slouken@1402
    26
#undef __AIX__
slouken@1402
    27
#define __AIX__		1
slouken@1402
    28
#endif
slouken@1402
    29
#if defined(AMIGA) || defined(__AMIGA) || defined(__amigados__)
slouken@1402
    30
/* FIXME: is this the right test for AmigaOS? */
slouken@1402
    31
#undef __AMIGA__
slouken@1402
    32
#define __AMIGA__	1
slouken@1402
    33
#endif
slouken@1402
    34
#if defined(__BEOS__)
slouken@1402
    35
#undef __BEOS__
slouken@1402
    36
#define __BEOS__	1
slouken@1402
    37
#endif
slouken@1402
    38
#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__)
slouken@1402
    39
#undef __BSDI__
slouken@1402
    40
#define __BSDI__	1
slouken@1402
    41
#endif
slouken@1402
    42
#if defined(DREAMCAST)
slouken@1402
    43
/* FIXME: is this the right test for Dreamcast? */
slouken@1402
    44
#undef __DREAMCAST__
slouken@1402
    45
#define __DREAMCAST__	1
slouken@1402
    46
#endif
slouken@1402
    47
#if defined(__FreeBSD__)
slouken@1402
    48
#undef __FREEBSD__
slouken@1402
    49
#define __FREEBSD__	1
slouken@1402
    50
#endif
slouken@1402
    51
#if defined(hpux) || defined(__hpux) || defined(__hpux__)
slouken@1402
    52
#undef __HPUX__
slouken@1402
    53
#define __HPUX__	1
slouken@1402
    54
#endif
slouken@1402
    55
#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE)
slouken@1402
    56
#undef __IRIX__
slouken@1402
    57
#define __IRIX__	1
slouken@1402
    58
#endif
slouken@1402
    59
#if defined(linux) || defined(__linux) || defined(__linux__)
slouken@1402
    60
#undef __LINUX__
slouken@1402
    61
#define __LINUX__	1
slouken@1402
    62
#endif
slouken@1402
    63
#if defined(macintosh)
slouken@1402
    64
#undef __MACOS__
slouken@1402
    65
#define __MACOS__	1
slouken@1402
    66
#endif
slouken@1402
    67
#if defined(__GNUC__) && (defined(__APPLE_CC__) || defined(__APPLE_CPP__))
slouken@1402
    68
#undef __MACOSX__
slouken@1402
    69
#define __MACOSX__	1
slouken@1402
    70
#define TARGET_API_MAC_CARBON	1
slouken@1402
    71
#endif
slouken@1402
    72
#if defined(__NetBSD__)
slouken@1402
    73
#undef __NETBSD__
slouken@1402
    74
#define __NETBSD__	1
slouken@1402
    75
#endif
slouken@1402
    76
#if defined(__OpenBSD__)
slouken@1402
    77
#undef __OPENBSD__
slouken@1402
    78
#define __OPENBSD__	1
slouken@1402
    79
#endif
slouken@1402
    80
#if defined(__OS2__)
slouken@1402
    81
#undef __OS2__
slouken@1402
    82
#define __OS2__		1
slouken@1402
    83
#endif
slouken@1402
    84
#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE)
slouken@1402
    85
#undef __OSF__
slouken@1402
    86
#define __OSF__		1
slouken@1402
    87
#endif
slouken@1402
    88
#if defined(__QNXNTO__)
slouken@1402
    89
#undef __QNXNTO__
slouken@1402
    90
#define __QNXNTO__	1
slouken@1402
    91
#endif
slouken@1402
    92
#if defined(riscos) || defined(__riscos) || defined(__riscos__)
slouken@1402
    93
#undef __RISCOS__
slouken@1402
    94
#define __RISCOS__	1
slouken@1402
    95
#endif
slouken@1402
    96
#if defined(solaris) || defined(__solaris) || defined(__solaris__)
slouken@1402
    97
/* FIXME: is this the right test for Solaris? Check SDL_sunaudio.c */
slouken@1402
    98
#undef __SOLARIS__
slouken@1402
    99
#define __SOLARIS__	1
slouken@1402
   100
#endif
slouken@1402
   101
#if defined(WIN32) || defined(_WIN32)
slouken@1402
   102
#undef __WIN32__
slouken@1402
   103
#define __WIN32__	1
slouken@1402
   104
#endif