include/begin_code.h
author David Ludwig <dludwig@pobox.com>
Sun, 21 Apr 2013 12:49:15 -0400
changeset 8465 be2dce468a8c
parent 8461 ca8dad9be3d4
child 8477 ad08f0d710f3
permissions -rw-r--r--
WinRT: removed the "generic" + C++/CX hack-fix, now that a better fix is in official-SDL
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     1
/*
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
     2
  Simple DirectMedia Layer
6885
700f1b25f77f Happy New Year!
Sam Lantinga <slouken@libsdl.org>
parents: 6204
diff changeset
     3
  Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     4
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
     5
  This software is provided 'as-is', without any express or implied
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
     6
  warranty.  In no event will the authors be held liable for any damages
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
     7
  arising from the use of this software.
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     8
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
     9
  Permission is granted to anyone to use this software for any purpose,
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    10
  including commercial applications, and to alter it and redistribute it
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    11
  freely, subject to the following restrictions:
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    12
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    13
  1. The origin of this software must not be misrepresented; you must not
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    14
     claim that you wrote the original software. If you use this software
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    15
     in a product, an acknowledgment in the product documentation would be
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    16
     appreciated but is not required.
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    17
  2. Altered source versions must be plainly marked as such, and must not be
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    18
     misrepresented as being the original software.
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    19
  3. This notice may not be removed or altered from any source distribution.
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    20
*/
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    21
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3292
diff changeset
    22
/**
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3292
diff changeset
    23
 *  \file begin_code.h
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3292
diff changeset
    24
 *
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3292
diff changeset
    25
 *  This file sets things up for C dynamic library function definitions,
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3292
diff changeset
    26
 *  static inlined functions, and structures aligned at 4-byte alignment.
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3292
diff changeset
    27
 *  If you don't like ugly C preprocessor code, don't look at this file. :)
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3292
diff changeset
    28
 */
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    29
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    30
/* This shouldn't be nested -- included it around code only. */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    31
#ifdef _begin_code_h
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    32
#error Nested inclusion of begin_code.h
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    33
#endif
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    34
#define _begin_code_h
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    35
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    36
/* Some compilers use a special export keyword */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    37
#ifndef DECLSPEC
3292
245a7d79577c Fixed bug #615
Sam Lantinga <slouken@libsdl.org>
parents: 3269
diff changeset
    38
# if defined(__BEOS__) || defined(__HAIKU__)
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    39
#  if defined(__GNUC__)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    40
#   define DECLSPEC	__declspec(dllexport)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    41
#  else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    42
#   define DECLSPEC	__declspec(export)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    43
#  endif
8319
3fee3e6b616b WinRT: used Win32-style DECLSPEC and SDLCALL macros (for building a .dll)
David Ludwig <dludwig@pobox.com>
parents: 6204
diff changeset
    44
# elif defined(__WIN32__) || defined(__WINRT__)
274
051b991765ba David Snopek added Borland compiler support
Sam Lantinga <slouken@libsdl.org>
parents: 251
diff changeset
    45
#  ifdef __BORLANDC__
051b991765ba David Snopek added Borland compiler support
Sam Lantinga <slouken@libsdl.org>
parents: 251
diff changeset
    46
#   ifdef BUILD_SDL
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1621
diff changeset
    47
#    define DECLSPEC
274
051b991765ba David Snopek added Borland compiler support
Sam Lantinga <slouken@libsdl.org>
parents: 251
diff changeset
    48
#   else
1574
0fd72308659e Default to use the visibility attribute, on gcc (is this okay?)
Sam Lantinga <slouken@libsdl.org>
parents: 1573
diff changeset
    49
#    define DECLSPEC	__declspec(dllimport)
274
051b991765ba David Snopek added Borland compiler support
Sam Lantinga <slouken@libsdl.org>
parents: 251
diff changeset
    50
#   endif
051b991765ba David Snopek added Borland compiler support
Sam Lantinga <slouken@libsdl.org>
parents: 251
diff changeset
    51
#  else
051b991765ba David Snopek added Borland compiler support
Sam Lantinga <slouken@libsdl.org>
parents: 251
diff changeset
    52
#   define DECLSPEC	__declspec(dllexport)
051b991765ba David Snopek added Borland compiler support
Sam Lantinga <slouken@libsdl.org>
parents: 251
diff changeset
    53
#  endif
1190
173c063d4f55 OS/2 port!
Ryan C. Gordon <icculus@icculus.org>
parents: 1025
diff changeset
    54
# else
1595
4aa7df2476e7 Only use the visibility attribute in gcc 4.0 or newer
Sam Lantinga <slouken@libsdl.org>
parents: 1574
diff changeset
    55
#  if defined(__GNUC__) && __GNUC__ >= 4
1574
0fd72308659e Default to use the visibility attribute, on gcc (is this okay?)
Sam Lantinga <slouken@libsdl.org>
parents: 1573
diff changeset
    56
#   define DECLSPEC	__attribute__ ((visibility("default")))
0fd72308659e Default to use the visibility attribute, on gcc (is this okay?)
Sam Lantinga <slouken@libsdl.org>
parents: 1573
diff changeset
    57
#  else
0fd72308659e Default to use the visibility attribute, on gcc (is this okay?)
Sam Lantinga <slouken@libsdl.org>
parents: 1573
diff changeset
    58
#   define DECLSPEC
0fd72308659e Default to use the visibility attribute, on gcc (is this okay?)
Sam Lantinga <slouken@libsdl.org>
parents: 1573
diff changeset
    59
#  endif
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    60
# endif
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    61
#endif
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    62
337
9154ec9ca3d2 Explicitly specify the SDL API calling convention (C by default)
Sam Lantinga <slouken@libsdl.org>
parents: 297
diff changeset
    63
/* By default SDL uses the C calling convention */
9154ec9ca3d2 Explicitly specify the SDL API calling convention (C by default)
Sam Lantinga <slouken@libsdl.org>
parents: 297
diff changeset
    64
#ifndef SDLCALL
8319
3fee3e6b616b WinRT: used Win32-style DECLSPEC and SDLCALL macros (for building a .dll)
David Ludwig <dludwig@pobox.com>
parents: 6204
diff changeset
    65
#if (defined(__WIN32__) || defined(__WINRT__)) && !defined(__GNUC__)
3620
838fcbc09c68 The OS/2 support has been removed, so we don't need this now.
Sam Lantinga <slouken@libsdl.org>
parents: 3618
diff changeset
    66
#define SDLCALL __cdecl
838fcbc09c68 The OS/2 support has been removed, so we don't need this now.
Sam Lantinga <slouken@libsdl.org>
parents: 3618
diff changeset
    67
#else
838fcbc09c68 The OS/2 support has been removed, so we don't need this now.
Sam Lantinga <slouken@libsdl.org>
parents: 3618
diff changeset
    68
#define SDLCALL
838fcbc09c68 The OS/2 support has been removed, so we don't need this now.
Sam Lantinga <slouken@libsdl.org>
parents: 3618
diff changeset
    69
#endif
337
9154ec9ca3d2 Explicitly specify the SDL API calling convention (C by default)
Sam Lantinga <slouken@libsdl.org>
parents: 297
diff changeset
    70
#endif /* SDLCALL */
9154ec9ca3d2 Explicitly specify the SDL API calling convention (C by default)
Sam Lantinga <slouken@libsdl.org>
parents: 297
diff changeset
    71
173
83018110dce8 Added initial support for EPOC/Symbian OS (thanks Hannu!)
Sam Lantinga <slouken@libsdl.org>
parents: 85
diff changeset
    72
/* Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC */
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1621
diff changeset
    73
#ifdef __SYMBIAN32__
173
83018110dce8 Added initial support for EPOC/Symbian OS (thanks Hannu!)
Sam Lantinga <slouken@libsdl.org>
parents: 85
diff changeset
    74
#undef DECLSPEC
83018110dce8 Added initial support for EPOC/Symbian OS (thanks Hannu!)
Sam Lantinga <slouken@libsdl.org>
parents: 85
diff changeset
    75
#define DECLSPEC
187
94645dc9479b *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 173
diff changeset
    76
#endif /* __SYMBIAN32__ */
173
83018110dce8 Added initial support for EPOC/Symbian OS (thanks Hannu!)
Sam Lantinga <slouken@libsdl.org>
parents: 85
diff changeset
    77
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    78
/* Force structure packing at 4 byte alignment.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    79
   This is necessary if the header is included in code which has structure
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    80
   packing set to an alternate value, say for loading structures from disk.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    81
   The packing is reset to the previous value in close_code.h
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    82
 */
288
2f5a6062db86 Updated for Watcom C++ and LCC compilers
Sam Lantinga <slouken@libsdl.org>
parents: 274
diff changeset
    83
#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    84
#ifdef _MSC_VER
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    85
#pragma warning(disable: 4103)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    86
#endif
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    87
#ifdef __BORLANDC__
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    88
#pragma nopackwarning
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    89
#endif
6204
dc2eb9370e82 Fixed structure alignment mismatch between Visual Studio and gcc on 64-bit architectures.
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
    90
#ifdef _M_X64
dc2eb9370e82 Fixed structure alignment mismatch between Visual Studio and gcc on 64-bit architectures.
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
    91
/* Use 8-byte alignment on 64-bit architectures, so pointers are aligned */
dc2eb9370e82 Fixed structure alignment mismatch between Visual Studio and gcc on 64-bit architectures.
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
    92
#pragma pack(push,8)
dc2eb9370e82 Fixed structure alignment mismatch between Visual Studio and gcc on 64-bit architectures.
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
    93
#else
195
3669d47b07d3 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 189
diff changeset
    94
#pragma pack(push,4)
6204
dc2eb9370e82 Fixed structure alignment mismatch between Visual Studio and gcc on 64-bit architectures.
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
    95
#endif
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    96
#endif /* Compiler needs structure packing set */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    97
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    98
/* Set up compiler-specific options for inlining functions */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    99
#ifndef SDL_INLINE_OKAY
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   100
#ifdef __GNUC__
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   101
#define SDL_INLINE_OKAY
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   102
#else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   103
/* Add any special compiler-specific cases here */
288
2f5a6062db86 Updated for Watcom C++ and LCC compilers
Sam Lantinga <slouken@libsdl.org>
parents: 274
diff changeset
   104
#if defined(_MSC_VER) || defined(__BORLANDC__) || \
2f5a6062db86 Updated for Watcom C++ and LCC compilers
Sam Lantinga <slouken@libsdl.org>
parents: 274
diff changeset
   105
    defined(__DMC__) || defined(__SC__) || \
1019
e3b3130f3af8 Date: Fri, 31 Dec 2004 04:14:09 +0900
Sam Lantinga <slouken@libsdl.org>
parents: 769
diff changeset
   106
    defined(__WATCOMC__) || defined(__LCC__) || \
e3b3130f3af8 Date: Fri, 31 Dec 2004 04:14:09 +0900
Sam Lantinga <slouken@libsdl.org>
parents: 769
diff changeset
   107
    defined(__DECC)
288
2f5a6062db86 Updated for Watcom C++ and LCC compilers
Sam Lantinga <slouken@libsdl.org>
parents: 274
diff changeset
   108
#ifndef __inline__
85
60c7960354e0 Added support for Visual C++ inline keyword
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
   109
#define __inline__	__inline
288
2f5a6062db86 Updated for Watcom C++ and LCC compilers
Sam Lantinga <slouken@libsdl.org>
parents: 274
diff changeset
   110
#endif
85
60c7960354e0 Added support for Visual C++ inline keyword
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
   111
#define SDL_INLINE_OKAY
60c7960354e0 Added support for Visual C++ inline keyword
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
   112
#else
60c7960354e0 Added support for Visual C++ inline keyword
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
   113
#if !defined(__MRC__) && !defined(_SGI_SOURCE)
2123
9a48d1a6fbec Merged r3075:3076 from branches/SDL-1.2: Careful with __inline__ #define.
Ryan C. Gordon <icculus@icculus.org>
parents: 1978
diff changeset
   114
#ifndef __inline__
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   115
#define __inline__ inline
2123
9a48d1a6fbec Merged r3075:3076 from branches/SDL-1.2: Careful with __inline__ #define.
Ryan C. Gordon <icculus@icculus.org>
parents: 1978
diff changeset
   116
#endif
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   117
#define SDL_INLINE_OKAY
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   118
#endif /* Not a funky compiler */
85
60c7960354e0 Added support for Visual C++ inline keyword
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
   119
#endif /* Visual C++ */
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   120
#endif /* GNU C */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   121
#endif /* SDL_INLINE_OKAY */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   122
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   123
/* If inlining isn't supported, remove "__inline__", turning static
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   124
   inlined functions into static functions (resulting in code bloat
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   125
   in all files which include the offending header files)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   126
*/
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   127
#ifndef SDL_INLINE_OKAY
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   128
#define __inline__
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   129
#endif
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   130
7054
9a9d05664124 Fixed compiler warnings in Mac Xcode builds.
Ryan C. Gordon <icculus@icculus.org>
parents: 7032
diff changeset
   131
#ifndef SDL_FORCE_INLINE
7002
978ff4e06388 Added an SDL_FORCE_INLINE macro.
Ryan C. Gordon <icculus@icculus.org>
parents: 6885
diff changeset
   132
#if defined(_MSC_VER)
978ff4e06388 Added an SDL_FORCE_INLINE macro.
Ryan C. Gordon <icculus@icculus.org>
parents: 6885
diff changeset
   133
#define SDL_FORCE_INLINE __forceinline
7032
305feca4f152 Fixed compiler warnings with SDL_FORCE_INLINE on gcc2. (Thanks, Axel!)
Ryan C. Gordon <icculus@icculus.org>
parents: 7002
diff changeset
   134
#elif ( (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) )
7002
978ff4e06388 Added an SDL_FORCE_INLINE macro.
Ryan C. Gordon <icculus@icculus.org>
parents: 6885
diff changeset
   135
#define SDL_FORCE_INLINE __attribute__((always_inline)) static inline
978ff4e06388 Added an SDL_FORCE_INLINE macro.
Ryan C. Gordon <icculus@icculus.org>
parents: 6885
diff changeset
   136
#else
978ff4e06388 Added an SDL_FORCE_INLINE macro.
Ryan C. Gordon <icculus@icculus.org>
parents: 6885
diff changeset
   137
#define SDL_FORCE_INLINE static __inline__
978ff4e06388 Added an SDL_FORCE_INLINE macro.
Ryan C. Gordon <icculus@icculus.org>
parents: 6885
diff changeset
   138
#endif
7054
9a9d05664124 Fixed compiler warnings in Mac Xcode builds.
Ryan C. Gordon <icculus@icculus.org>
parents: 7032
diff changeset
   139
#endif
7002
978ff4e06388 Added an SDL_FORCE_INLINE macro.
Ryan C. Gordon <icculus@icculus.org>
parents: 6885
diff changeset
   140
288
2f5a6062db86 Updated for Watcom C++ and LCC compilers
Sam Lantinga <slouken@libsdl.org>
parents: 274
diff changeset
   141
/* Apparently this is needed by several Windows compilers */
346
a18ea34d9efe Fixed precompiled headers on MacOS X
Sam Lantinga <slouken@libsdl.org>
parents: 337
diff changeset
   142
#if !defined(__MACH__)
288
2f5a6062db86 Updated for Watcom C++ and LCC compilers
Sam Lantinga <slouken@libsdl.org>
parents: 274
diff changeset
   143
#ifndef NULL
2f5a6062db86 Updated for Watcom C++ and LCC compilers
Sam Lantinga <slouken@libsdl.org>
parents: 274
diff changeset
   144
#ifdef __cplusplus
2f5a6062db86 Updated for Watcom C++ and LCC compilers
Sam Lantinga <slouken@libsdl.org>
parents: 274
diff changeset
   145
#define NULL 0
2f5a6062db86 Updated for Watcom C++ and LCC compilers
Sam Lantinga <slouken@libsdl.org>
parents: 274
diff changeset
   146
#else
2f5a6062db86 Updated for Watcom C++ and LCC compilers
Sam Lantinga <slouken@libsdl.org>
parents: 274
diff changeset
   147
#define NULL ((void *)0)
2f5a6062db86 Updated for Watcom C++ and LCC compilers
Sam Lantinga <slouken@libsdl.org>
parents: 274
diff changeset
   148
#endif
2f5a6062db86 Updated for Watcom C++ and LCC compilers
Sam Lantinga <slouken@libsdl.org>
parents: 274
diff changeset
   149
#endif /* NULL */
1621
f12379c41042 Fixes bug #195:
Sam Lantinga <slouken@libsdl.org>
parents: 1595
diff changeset
   150
#endif /* ! Mac OS X - breaks precompiled headers */