include/begin_code.h
author Sam Lantinga <slouken@libsdl.org>
Tue, 22 Oct 2013 21:53:58 -0700
changeset 7881 a74e5be22566
parent 7872 ca36ab2a8179
child 8149 681eb46b8ac4
child 8535 e8ee0708ef5c
permissions -rw-r--r--
SDL 2.0.0 defined __inline__ and some code relies on it now.
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
7665
4c0a6cfe27a0 Added SDL_DEPRECATED #define.
Ryan C. Gordon <icculus@icculus.org>
parents: 7657
diff changeset
    36
#ifndef SDL_DEPRECATED
4c0a6cfe27a0 Added SDL_DEPRECATED #define.
Ryan C. Gordon <icculus@icculus.org>
parents: 7657
diff changeset
    37
#  if (__GNUC__ >= 4)  /* technically, this arrived in gcc 3.1, but oh well. */
4c0a6cfe27a0 Added SDL_DEPRECATED #define.
Ryan C. Gordon <icculus@icculus.org>
parents: 7657
diff changeset
    38
#    define SDL_DEPRECATED __attribute__((deprecated))
4c0a6cfe27a0 Added SDL_DEPRECATED #define.
Ryan C. Gordon <icculus@icculus.org>
parents: 7657
diff changeset
    39
#  else
4c0a6cfe27a0 Added SDL_DEPRECATED #define.
Ryan C. Gordon <icculus@icculus.org>
parents: 7657
diff changeset
    40
#    define SDL_DEPRECATED
4c0a6cfe27a0 Added SDL_DEPRECATED #define.
Ryan C. Gordon <icculus@icculus.org>
parents: 7657
diff changeset
    41
#  endif
4c0a6cfe27a0 Added SDL_DEPRECATED #define.
Ryan C. Gordon <icculus@icculus.org>
parents: 7657
diff changeset
    42
#endif
4c0a6cfe27a0 Added SDL_DEPRECATED #define.
Ryan C. Gordon <icculus@icculus.org>
parents: 7657
diff changeset
    43
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    44
/* Some compilers use a special export keyword */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    45
#ifndef DECLSPEC
7657
7a8955fe2f63 Fixed warnings building with gcc 2 and gcc 4 on Haiku
Sam Lantinga <slouken@libsdl.org>
parents: 7191
diff changeset
    46
# if defined(__WIN32__)
274
051b991765ba David Snopek added Borland compiler support
Sam Lantinga <slouken@libsdl.org>
parents: 251
diff changeset
    47
#  ifdef __BORLANDC__
051b991765ba David Snopek added Borland compiler support
Sam Lantinga <slouken@libsdl.org>
parents: 251
diff changeset
    48
#   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
    49
#    define DECLSPEC
274
051b991765ba David Snopek added Borland compiler support
Sam Lantinga <slouken@libsdl.org>
parents: 251
diff changeset
    50
#   else
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7054
diff changeset
    51
#    define DECLSPEC    __declspec(dllimport)
274
051b991765ba David Snopek added Borland compiler support
Sam Lantinga <slouken@libsdl.org>
parents: 251
diff changeset
    52
#   endif
051b991765ba David Snopek added Borland compiler support
Sam Lantinga <slouken@libsdl.org>
parents: 251
diff changeset
    53
#  else
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7054
diff changeset
    54
#   define DECLSPEC __declspec(dllexport)
274
051b991765ba David Snopek added Borland compiler support
Sam Lantinga <slouken@libsdl.org>
parents: 251
diff changeset
    55
#  endif
1190
173c063d4f55 OS/2 port!
Ryan C. Gordon <icculus@icculus.org>
parents: 1025
diff changeset
    56
# else
1595
4aa7df2476e7 Only use the visibility attribute in gcc 4.0 or newer
Sam Lantinga <slouken@libsdl.org>
parents: 1574
diff changeset
    57
#  if defined(__GNUC__) && __GNUC__ >= 4
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7054
diff changeset
    58
#   define DECLSPEC __attribute__ ((visibility("default")))
7657
7a8955fe2f63 Fixed warnings building with gcc 2 and gcc 4 on Haiku
Sam Lantinga <slouken@libsdl.org>
parents: 7191
diff changeset
    59
#  elif defined(__GNUC__) && __GNUC__ >= 2
7a8955fe2f63 Fixed warnings building with gcc 2 and gcc 4 on Haiku
Sam Lantinga <slouken@libsdl.org>
parents: 7191
diff changeset
    60
#   define DECLSPEC __declspec(dllexport)
1574
0fd72308659e Default to use the visibility attribute, on gcc (is this okay?)
Sam Lantinga <slouken@libsdl.org>
parents: 1573
diff changeset
    61
#  else
0fd72308659e Default to use the visibility attribute, on gcc (is this okay?)
Sam Lantinga <slouken@libsdl.org>
parents: 1573
diff changeset
    62
#   define DECLSPEC
0fd72308659e Default to use the visibility attribute, on gcc (is this okay?)
Sam Lantinga <slouken@libsdl.org>
parents: 1573
diff changeset
    63
#  endif
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    64
# endif
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    65
#endif
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    66
337
9154ec9ca3d2 Explicitly specify the SDL API calling convention (C by default)
Sam Lantinga <slouken@libsdl.org>
parents: 297
diff changeset
    67
/* 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
    68
#ifndef SDLCALL
5086
c2539ff054c8 Fixed compiling on Windows Mobile SDK 5.0 with Visual Studio 2008
Sam Lantinga <slouken@libsdl.org>
parents: 5062
diff changeset
    69
#if defined(__WIN32__) && !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
    70
#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
    71
#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
    72
#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
    73
#endif
337
9154ec9ca3d2 Explicitly specify the SDL API calling convention (C by default)
Sam Lantinga <slouken@libsdl.org>
parents: 297
diff changeset
    74
#endif /* SDLCALL */
9154ec9ca3d2 Explicitly specify the SDL API calling convention (C by default)
Sam Lantinga <slouken@libsdl.org>
parents: 297
diff changeset
    75
173
83018110dce8 Added initial support for EPOC/Symbian OS (thanks Hannu!)
Sam Lantinga <slouken@libsdl.org>
parents: 85
diff changeset
    76
/* 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
    77
#ifdef __SYMBIAN32__
173
83018110dce8 Added initial support for EPOC/Symbian OS (thanks Hannu!)
Sam Lantinga <slouken@libsdl.org>
parents: 85
diff changeset
    78
#undef DECLSPEC
83018110dce8 Added initial support for EPOC/Symbian OS (thanks Hannu!)
Sam Lantinga <slouken@libsdl.org>
parents: 85
diff changeset
    79
#define DECLSPEC
187
94645dc9479b *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 173
diff changeset
    80
#endif /* __SYMBIAN32__ */
173
83018110dce8 Added initial support for EPOC/Symbian OS (thanks Hannu!)
Sam Lantinga <slouken@libsdl.org>
parents: 85
diff changeset
    81
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    82
/* Force structure packing at 4 byte alignment.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    83
   This is necessary if the header is included in code which has structure
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    84
   packing set to an alternate value, say for loading structures from disk.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    85
   The packing is reset to the previous value in close_code.h
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    86
 */
288
2f5a6062db86 Updated for Watcom C++ and LCC compilers
Sam Lantinga <slouken@libsdl.org>
parents: 274
diff changeset
    87
#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    88
#ifdef _MSC_VER
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    89
#pragma warning(disable: 4103)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    90
#endif
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    91
#ifdef __BORLANDC__
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    92
#pragma nopackwarning
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    93
#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
    94
#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
    95
/* 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
    96
#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
    97
#else
195
3669d47b07d3 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 189
diff changeset
    98
#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
    99
#endif
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   100
#endif /* Compiler needs structure packing set */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   101
7860
2b0bcdea3a79 Fixed bug 2129 - fix for bug 2121 breaks linking for mingw and throws multiple warnings
Sam Lantinga <slouken@libsdl.org>
parents: 7771
diff changeset
   102
#ifndef SDL_INLINE
7872
ca36ab2a8179 Better fix for bug 2129 - fix for bug 2121 breaks linking for mingw and throws multiple warnings
Sam Lantinga <slouken@libsdl.org>
parents: 7860
diff changeset
   103
#if defined(__GNUC__)
ca36ab2a8179 Better fix for bug 2129 - fix for bug 2121 breaks linking for mingw and throws multiple warnings
Sam Lantinga <slouken@libsdl.org>
parents: 7860
diff changeset
   104
#define SDL_INLINE __inline__
ca36ab2a8179 Better fix for bug 2129 - fix for bug 2121 breaks linking for mingw and throws multiple warnings
Sam Lantinga <slouken@libsdl.org>
parents: 7860
diff changeset
   105
#elif defined(_MSC_VER) || defined(__BORLANDC__) || \
ca36ab2a8179 Better fix for bug 2129 - fix for bug 2121 breaks linking for mingw and throws multiple warnings
Sam Lantinga <slouken@libsdl.org>
parents: 7860
diff changeset
   106
      defined(__DMC__) || defined(__SC__) || \
ca36ab2a8179 Better fix for bug 2129 - fix for bug 2121 breaks linking for mingw and throws multiple warnings
Sam Lantinga <slouken@libsdl.org>
parents: 7860
diff changeset
   107
      defined(__WATCOMC__) || defined(__LCC__) || \
ca36ab2a8179 Better fix for bug 2129 - fix for bug 2121 breaks linking for mingw and throws multiple warnings
Sam Lantinga <slouken@libsdl.org>
parents: 7860
diff changeset
   108
      defined(__DECC)
ca36ab2a8179 Better fix for bug 2129 - fix for bug 2121 breaks linking for mingw and throws multiple warnings
Sam Lantinga <slouken@libsdl.org>
parents: 7860
diff changeset
   109
#define SDL_INLINE __inline
7881
a74e5be22566 SDL 2.0.0 defined __inline__ and some code relies on it now.
Sam Lantinga <slouken@libsdl.org>
parents: 7872
diff changeset
   110
#ifndef __inline__
a74e5be22566 SDL 2.0.0 defined __inline__ and some code relies on it now.
Sam Lantinga <slouken@libsdl.org>
parents: 7872
diff changeset
   111
#define __inline__ __inline
a74e5be22566 SDL 2.0.0 defined __inline__ and some code relies on it now.
Sam Lantinga <slouken@libsdl.org>
parents: 7872
diff changeset
   112
#endif
85
60c7960354e0 Added support for Visual C++ inline keyword
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
   113
#else
7860
2b0bcdea3a79 Fixed bug 2129 - fix for bug 2121 breaks linking for mingw and throws multiple warnings
Sam Lantinga <slouken@libsdl.org>
parents: 7771
diff changeset
   114
#define SDL_INLINE inline
7881
a74e5be22566 SDL 2.0.0 defined __inline__ and some code relies on it now.
Sam Lantinga <slouken@libsdl.org>
parents: 7872
diff changeset
   115
#ifndef __inline__
a74e5be22566 SDL 2.0.0 defined __inline__ and some code relies on it now.
Sam Lantinga <slouken@libsdl.org>
parents: 7872
diff changeset
   116
#define __inline__ inline
a74e5be22566 SDL 2.0.0 defined __inline__ and some code relies on it now.
Sam Lantinga <slouken@libsdl.org>
parents: 7872
diff changeset
   117
#endif
7872
ca36ab2a8179 Better fix for bug 2129 - fix for bug 2121 breaks linking for mingw and throws multiple warnings
Sam Lantinga <slouken@libsdl.org>
parents: 7860
diff changeset
   118
#endif
7860
2b0bcdea3a79 Fixed bug 2129 - fix for bug 2121 breaks linking for mingw and throws multiple warnings
Sam Lantinga <slouken@libsdl.org>
parents: 7771
diff changeset
   119
#endif /* SDL_INLINE not defined */
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   120
7054
9a9d05664124 Fixed compiler warnings in Mac Xcode builds.
Ryan C. Gordon <icculus@icculus.org>
parents: 7032
diff changeset
   121
#ifndef SDL_FORCE_INLINE
7002
978ff4e06388 Added an SDL_FORCE_INLINE macro.
Ryan C. Gordon <icculus@icculus.org>
parents: 6885
diff changeset
   122
#if defined(_MSC_VER)
978ff4e06388 Added an SDL_FORCE_INLINE macro.
Ryan C. Gordon <icculus@icculus.org>
parents: 6885
diff changeset
   123
#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
   124
#elif ( (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) )
7872
ca36ab2a8179 Better fix for bug 2129 - fix for bug 2121 breaks linking for mingw and throws multiple warnings
Sam Lantinga <slouken@libsdl.org>
parents: 7860
diff changeset
   125
#define SDL_FORCE_INLINE __attribute__((always_inline)) static __inline__
7002
978ff4e06388 Added an SDL_FORCE_INLINE macro.
Ryan C. Gordon <icculus@icculus.org>
parents: 6885
diff changeset
   126
#else
7860
2b0bcdea3a79 Fixed bug 2129 - fix for bug 2121 breaks linking for mingw and throws multiple warnings
Sam Lantinga <slouken@libsdl.org>
parents: 7771
diff changeset
   127
#define SDL_FORCE_INLINE static SDL_INLINE
7002
978ff4e06388 Added an SDL_FORCE_INLINE macro.
Ryan C. Gordon <icculus@icculus.org>
parents: 6885
diff changeset
   128
#endif
7860
2b0bcdea3a79 Fixed bug 2129 - fix for bug 2121 breaks linking for mingw and throws multiple warnings
Sam Lantinga <slouken@libsdl.org>
parents: 7771
diff changeset
   129
#endif /* SDL_FORCE_INLINE not defined */
7002
978ff4e06388 Added an SDL_FORCE_INLINE macro.
Ryan C. Gordon <icculus@icculus.org>
parents: 6885
diff changeset
   130
288
2f5a6062db86 Updated for Watcom C++ and LCC compilers
Sam Lantinga <slouken@libsdl.org>
parents: 274
diff changeset
   131
/* 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
   132
#if !defined(__MACH__)
288
2f5a6062db86 Updated for Watcom C++ and LCC compilers
Sam Lantinga <slouken@libsdl.org>
parents: 274
diff changeset
   133
#ifndef NULL
2f5a6062db86 Updated for Watcom C++ and LCC compilers
Sam Lantinga <slouken@libsdl.org>
parents: 274
diff changeset
   134
#ifdef __cplusplus
2f5a6062db86 Updated for Watcom C++ and LCC compilers
Sam Lantinga <slouken@libsdl.org>
parents: 274
diff changeset
   135
#define NULL 0
2f5a6062db86 Updated for Watcom C++ and LCC compilers
Sam Lantinga <slouken@libsdl.org>
parents: 274
diff changeset
   136
#else
2f5a6062db86 Updated for Watcom C++ and LCC compilers
Sam Lantinga <slouken@libsdl.org>
parents: 274
diff changeset
   137
#define NULL ((void *)0)
2f5a6062db86 Updated for Watcom C++ and LCC compilers
Sam Lantinga <slouken@libsdl.org>
parents: 274
diff changeset
   138
#endif
2f5a6062db86 Updated for Watcom C++ and LCC compilers
Sam Lantinga <slouken@libsdl.org>
parents: 274
diff changeset
   139
#endif /* NULL */
1621
f12379c41042 Fixes bug #195:
Sam Lantinga <slouken@libsdl.org>
parents: 1595
diff changeset
   140
#endif /* ! Mac OS X - breaks precompiled headers */