| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | #ifdef SDL_begin_code_h |
| 32 | #error Nested inclusion of begin_code.h |
| 33 | #endif |
| 34 | #define SDL_begin_code_h |
| 35 | |
| 36 | #ifndef SDL_DEPRECATED |
| 37 | # if defined(__GNUC__) && (__GNUC__ >= 4) |
| 38 | # define SDL_DEPRECATED __attribute__((deprecated)) |
| 39 | # elif defined(_MSC_VER) |
| 40 | # define SDL_DEPRECATED __declspec(deprecated) |
| 41 | # else |
| 42 | # define SDL_DEPRECATED |
| 43 | # endif |
| 44 | #endif |
| 45 | |
| 46 | #ifndef SDL_UNUSED |
| 47 | # ifdef __GNUC__ |
| 48 | # define SDL_UNUSED __attribute__((unused)) |
| 49 | # else |
| 50 | # define SDL_UNUSED |
| 51 | # endif |
| 52 | #endif |
| 53 | |
| 54 | |
| 55 | #ifndef DECLSPEC |
| 56 | # if defined(__WIN32__) || defined(__WINRT__) || defined(__CYGWIN__) || defined(__GDK__) |
| 57 | # ifdef DLL_EXPORT |
| 58 | # define DECLSPEC __declspec(dllexport) |
| 59 | # else |
| 60 | # define DECLSPEC |
| 61 | # endif |
| 62 | # elif defined(__OS2__) |
| 63 | # ifdef BUILD_SDL |
| 64 | # define DECLSPEC __declspec(dllexport) |
| 65 | # else |
| 66 | # define DECLSPEC |
| 67 | # endif |
| 68 | # else |
| 69 | # if defined(__GNUC__) && __GNUC__ >= 4 |
| 70 | # define DECLSPEC __attribute__ ((visibility("default"))) |
| 71 | # else |
| 72 | # define DECLSPEC |
| 73 | # endif |
| 74 | # endif |
| 75 | #endif |
| 76 | |
| 77 | |
| 78 | #ifndef SDLCALL |
| 79 | #if (defined(__WIN32__) || defined(__WINRT__) || defined(__GDK__)) && !defined(__GNUC__) |
| 80 | #define SDLCALL __cdecl |
| 81 | #elif defined(__OS2__) || defined(__EMX__) |
| 82 | #define SDLCALL _System |
| 83 | # if defined (__GNUC__) && !defined(_System) |
| 84 | # define _System |
| 85 | # endif |
| 86 | #else |
| 87 | #define SDLCALL |
| 88 | #endif |
| 89 | #endif |
| 90 | |
| 91 | |
| 92 | #ifdef __SYMBIAN32__ |
| 93 | #undef DECLSPEC |
| 94 | #define DECLSPEC |
| 95 | #endif |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) |
| 103 | #ifdef _MSC_VER |
| 104 | #pragma warning(disable: 4103) |
| 105 | #endif |
| 106 | #ifdef __clang__ |
| 107 | #pragma clang diagnostic ignored "-Wpragma-pack" |
| 108 | #endif |
| 109 | #ifdef __BORLANDC__ |
| 110 | #pragma nopackwarning |
| 111 | #endif |
| 112 | #ifdef _WIN64 |
| 113 | |
| 114 | #pragma pack(push,8) |
| 115 | #else |
| 116 | #pragma pack(push,4) |
| 117 | #endif |
| 118 | #endif |
| 119 | |
| 120 | #ifndef SDL_INLINE |
| 121 | #if defined(__GNUC__) |
| 122 | #define SDL_INLINE __inline__ |
| 123 | #elif defined(_MSC_VER) || defined(__BORLANDC__) || \ |
| 124 | defined(__DMC__) || defined(__SC__) || \ |
| 125 | defined(__WATCOMC__) || defined(__LCC__) || \ |
| 126 | defined(__DECC) || defined(__CC_ARM) |
| 127 | #define SDL_INLINE __inline |
| 128 | #ifndef __inline__ |
| 129 | #define __inline__ __inline |
| 130 | #endif |
| 131 | #else |
| 132 | #define SDL_INLINE inline |
| 133 | #ifndef __inline__ |
| 134 | #define __inline__ inline |
| 135 | #endif |
| 136 | #endif |
| 137 | #endif |
| 138 | |
| 139 | #ifndef SDL_FORCE_INLINE |
| 140 | #if defined(_MSC_VER) |
| 141 | #define SDL_FORCE_INLINE __forceinline |
| 142 | #elif ( (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) ) |
| 143 | #define SDL_FORCE_INLINE __attribute__((always_inline)) static __inline__ |
| 144 | #else |
| 145 | #define SDL_FORCE_INLINE static SDL_INLINE |
| 146 | #endif |
| 147 | #endif |
| 148 | |
| 149 | #ifndef SDL_NORETURN |
| 150 | #if defined(__GNUC__) |
| 151 | #define SDL_NORETURN __attribute__((noreturn)) |
| 152 | #elif defined(_MSC_VER) |
| 153 | #define SDL_NORETURN __declspec(noreturn) |
| 154 | #else |
| 155 | #define SDL_NORETURN |
| 156 | #endif |
| 157 | #endif |
| 158 | |
| 159 | |
| 160 | #if !defined(__MACH__) |
| 161 | #ifndef NULL |
| 162 | #ifdef __cplusplus |
| 163 | #define NULL 0 |
| 164 | #else |
| 165 | #define NULL ((void *)0) |
| 166 | #endif |
| 167 | #endif |
| 168 | #endif |
| 169 | |
| 170 | #ifndef SDL_FALLTHROUGH |
| 171 | #if (defined(__cplusplus) && __cplusplus >= 201703L) || \ |
| 172 | (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202000L) |
| 173 | #define SDL_FALLTHROUGH [[fallthrough]] |
| 174 | #else |
| 175 | #if defined(__has_attribute) && !defined(__SUNPRO_C) && !defined(__SUNPRO_CC) |
| 176 | #define SDL_HAS_FALLTHROUGH __has_attribute(__fallthrough__) |
| 177 | #else |
| 178 | #define SDL_HAS_FALLTHROUGH 0 |
| 179 | #endif |
| 180 | #if SDL_HAS_FALLTHROUGH && \ |
| 181 | ((defined(__GNUC__) && __GNUC__ >= 7) || \ |
| 182 | (defined(__clang_major__) && __clang_major__ >= 10)) |
| 183 | #define SDL_FALLTHROUGH __attribute__((__fallthrough__)) |
| 184 | #else |
| 185 | #define SDL_FALLTHROUGH do {} while (0) |
| 186 | #endif |
| 187 | #undef SDL_HAS_FALLTHROUGH |
| 188 | #endif |
| 189 | #endif |