include/SDL_platform.h
author Sam Lantinga <slouken@libsdl.org>
Mon, 21 Sep 2009 09:21:00 +0000
changeset 3292 245a7d79577c
parent 2871 cf09447f3d3c
child 3319 63d4517fc4ac
permissions -rw-r--r--
Fixed bug #615

Scott McCreary 2008-08-21 10:48:14 PDT

This patch adds support for Haiku.
http://ports.haiku-files.org/browser/haikuports/trunk/media-libs/libsdl/SDL-1.2.13-haiku.diff
Haiku is an open-source recreation of BeOS. It has better POSIX compliance
than beOS did, and other improved features, which in some cases causes us to
have to "undo" previous BeOS workarounds.
Here's our port log entry for it, showing the steps to force the changes into
configure and Makefile:
http://ports.haiku-files.org/wiki/media-libs/libsdl/1.2.13/1
Note that this was only tried on 1.2.13 stable so far.
Haiku is using a newer config.guess / config.sub that doesn't yet seem to be in
the released libtool, so we are having to copy it in for now.
http://haiku-files.org/files/optional-packages/
slouken@1402
     1
/*
slouken@1402
     2
    SDL - Simple DirectMedia Layer
slouken@2859
     3
    Copyright (C) 1997-2009 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@1406
    25
#ifndef _SDL_platform_h
slouken@1406
    26
#define _SDL_platform_h
slouken@1406
    27
slouken@1402
    28
#if defined(_AIX)
slouken@1402
    29
#undef __AIX__
slouken@1402
    30
#define __AIX__		1
slouken@1402
    31
#endif
slouken@1402
    32
#if defined(__BEOS__)
slouken@1402
    33
#undef __BEOS__
slouken@1402
    34
#define __BEOS__	1
slouken@1402
    35
#endif
slouken@3292
    36
#if defined(__HAIKU__)
slouken@3292
    37
#undef __HAIKU__
slouken@3292
    38
#define __HAIKU__	1
slouken@3292
    39
#endif
slouken@1402
    40
#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__)
slouken@1402
    41
#undef __BSDI__
slouken@1402
    42
#define __BSDI__	1
slouken@1402
    43
#endif
slouken@1461
    44
#if defined(_arch_dreamcast)
slouken@1402
    45
#undef __DREAMCAST__
slouken@1402
    46
#define __DREAMCAST__	1
slouken@1402
    47
#endif
slouken@1565
    48
#if defined(__FreeBSD__) || defined(__DragonFly__)
slouken@1402
    49
#undef __FREEBSD__
slouken@1402
    50
#define __FREEBSD__	1
slouken@1402
    51
#endif
slouken@1402
    52
#if defined(hpux) || defined(__hpux) || defined(__hpux__)
slouken@1402
    53
#undef __HPUX__
slouken@1402
    54
#define __HPUX__	1
slouken@1402
    55
#endif
slouken@1402
    56
#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE)
slouken@1402
    57
#undef __IRIX__
slouken@1402
    58
#define __IRIX__	1
slouken@1402
    59
#endif
slouken@1402
    60
#if defined(linux) || defined(__linux) || defined(__linux__)
slouken@1402
    61
#undef __LINUX__
slouken@1402
    62
#define __LINUX__	1
slouken@1402
    63
#endif
slouken@2765
    64
slouken@1631
    65
#if defined(__APPLE__)
slouken@2765
    66
/* lets us know what version of Mac OS X we're compiling on */
slouken@2765
    67
#include "AvailabilityMacros.h"
slouken@2765
    68
#ifdef MAC_OS_X_VERSION_10_3
slouken@2871
    69
#include "TargetConditionals.h" /* this header is in 10.3 or later */
slouken@2765
    70
#if TARGET_OS_IPHONE
slouken@2765
    71
/* if compiling for iPhone */
slouken@2765
    72
#undef __IPHONEOS__
slouken@2765
    73
#define __IPHONEOS__ 1
slouken@2765
    74
#undef __MACOSX__
slouken@2765
    75
#else
slouken@2765
    76
/* if not compiling for iPhone */
slouken@1402
    77
#undef __MACOSX__
slouken@1402
    78
#define __MACOSX__	1
slouken@2765
    79
#endif /* TARGET_OS_IPHONE */
slouken@2765
    80
#else
slouken@2765
    81
/* if earlier verion of Mac OS X than version 10.3 */
slouken@2765
    82
#undef __MACOSX__
slouken@2765
    83
#define __MACOSX__	1
slouken@1402
    84
#endif
slouken@2765
    85
slouken@2765
    86
#endif /* defined(__APPLE__) */
slouken@2765
    87
slouken@1402
    88
#if defined(__NetBSD__)
slouken@1402
    89
#undef __NETBSD__
slouken@1402
    90
#define __NETBSD__	1
slouken@1402
    91
#endif
slouken@1402
    92
#if defined(__OpenBSD__)
slouken@1402
    93
#undef __OPENBSD__
slouken@1402
    94
#define __OPENBSD__	1
slouken@1402
    95
#endif
slouken@1402
    96
#if defined(__OS2__)
slouken@1402
    97
#undef __OS2__
slouken@1402
    98
#define __OS2__		1
slouken@1402
    99
#endif
slouken@1402
   100
#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE)
slouken@1402
   101
#undef __OSF__
slouken@1402
   102
#define __OSF__		1
slouken@1402
   103
#endif
slouken@1402
   104
#if defined(__QNXNTO__)
slouken@1402
   105
#undef __QNXNTO__
slouken@1402
   106
#define __QNXNTO__	1
slouken@1402
   107
#endif
slouken@1402
   108
#if defined(riscos) || defined(__riscos) || defined(__riscos__)
slouken@1402
   109
#undef __RISCOS__
slouken@1402
   110
#define __RISCOS__	1
slouken@1402
   111
#endif
slouken@1631
   112
#if defined(__SVR4)
slouken@1402
   113
#undef __SOLARIS__
slouken@1402
   114
#define __SOLARIS__	1
slouken@1402
   115
#endif
slouken@1402
   116
#if defined(WIN32) || defined(_WIN32)
slouken@1402
   117
#undef __WIN32__
slouken@1402
   118
#define __WIN32__	1
slouken@1402
   119
#endif
slouken@1406
   120
slouken@2735
   121
#if defined(__NDS__)
slouken@2735
   122
#undef __NINTENDODS__
slouken@2735
   123
#define __NINTENDODS__	1
slouken@2735
   124
#endif
slouken@2735
   125
slouken@1406
   126
#endif /* _SDL_platform_h */