1 /* 2 Simple DirectMedia Layer 3 Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> 4 5 This software is provided 'as-is', without any express or implied 6 warranty. In no event will the authors be held liable for any damages 7 arising from the use of this software. 8 9 Permission is granted to anyone to use this software for any purpose, 10 including commercial applications, and to alter it and redistribute it 11 freely, subject to the following restrictions: 12 13 1. The origin of this software must not be misrepresented; you must not 14 claim that you wrote the original software. If you use this software 15 in a product, an acknowledgment in the product documentation would be 16 appreciated but is not required. 17 2. Altered source versions must be plainly marked as such, and must not be 18 misrepresented as being the original software. 19 3. This notice may not be removed or altered from any source distribution. 20 */ 21 22 /* 23 * This file #includes the proper SDL 2.0 headers, but #defines a whole 24 * bunch of stuff so we don't conflict with symbols we plan to offer with 25 * the 1.2 signatures. Ugly business. 26 */ 27 28 #ifndef _INCL_SDL20_INCLUDE_WRAPPER_H_ 29 #define _INCL_SDL20_INCLUDE_WRAPPER_H_ 30 31 #define SDL_GetVersion IGNORE_THIS_VERSION_OF_SDL_GetVersion 32 #define SDL_Log IGNORE_THIS_VERSION_OF_SDL_Log 33 #define SDL_ReportAssertion IGNORE_THIS_VERSION_OF_SDL_ReportAssertion 34 #define SDL_Error IGNORE_THIS_VERSION_OF_SDL_Error 35 #define SDL_SetError IGNORE_THIS_VERSION_OF_SDL_SetError 36 #define SDL_PollEvent IGNORE_THIS_VERSION_OF_SDL_PollEvent 37 #define SDL_PushEvent IGNORE_THIS_VERSION_OF_SDL_PushEvent 38 #define SDL_EventState IGNORE_THIS_VERSION_OF_SDL_EventState 39 #define SDL_PeepEvents IGNORE_THIS_VERSION_OF_SDL_PeepEvents 40 #define SDL_WaitEvent IGNORE_THIS_VERSION_OF_SDL_WaitEvent 41 #define SDL_SetEventFilter IGNORE_THIS_VERSION_OF_SDL_SetEventFilter 42 #define SDL_GetEventFilter IGNORE_THIS_VERSION_OF_SDL_GetEventFilter 43 #define SDL_CreateRGBSurface IGNORE_THIS_VERSION_OF_SDL_CreateRGBSurface 44 #define SDL_CreateRGBSurfaceFrom IGNORE_THIS_VERSION_OF_SDL_CreateRGBSurfaceFrom 45 #define SDL_FreeSurface IGNORE_THIS_VERSION_OF_SDL_FreeSurface 46 #define SDL_SetClipRect IGNORE_THIS_VERSION_OF_SDL_SetClipRect 47 #define SDL_GetClipRect IGNORE_THIS_VERSION_OF_SDL_GetClipRect 48 #define SDL_FillRect IGNORE_THIS_VERSION_OF_SDL_FillRect 49 #define SDL_GetRGB IGNORE_THIS_VERSION_OF_SDL_GetRGB 50 #define SDL_GetRGBA IGNORE_THIS_VERSION_OF_SDL_GetRGBA 51 #define SDL_MapRGB IGNORE_THIS_VERSION_OF_SDL_MapRGB 52 #define SDL_MapRGBA IGNORE_THIS_VERSION_OF_SDL_MapRGBA 53 #define SDL_CreateCursor IGNORE_THIS_VERSION_OF_SDL_CreateCursor 54 #define SDL_SetCursor IGNORE_THIS_VERSION_OF_SDL_SetCursor 55 #define SDL_GetCursor IGNORE_THIS_VERSION_OF_SDL_GetCursor 56 #define SDL_FreeCursor IGNORE_THIS_VERSION_OF_SDL_FreeCursor 57 #define SDL_UpdateRect IGNORE_THIS_VERSION_OF_SDL_UpdateRect 58 #define SDL_UpdateRects IGNORE_THIS_VERSION_OF_SDL_UpdateRects 59 #define SDL_GetMouseState IGNORE_THIS_VERSION_OF_SDL_GetMouseState 60 #define SDL_GetRelativeMouseState IGNORE_THIS_VERSION_OF_SDL_GetRelativeMouseState 61 #define SDL_GL_SetAttribute IGNORE_THIS_VERSION_OF_SDL_GL_SetAttribute 62 #define SDL_GL_GetAttribute IGNORE_THIS_VERSION_OF_SDL_GL_GetAttribute 63 #define SDL_CreateThread IGNORE_THIS_VERSION_OF_SDL_CreateThread 64 #define SDL_AddTimer IGNORE_THIS_VERSION_OF_SDL_AddTimer 65 #define SDL_RemoveTimer IGNORE_THIS_VERSION_OF_SDL_RemoveTimer 66 #define SDL_AllocRW IGNORE_THIS_VERSION_OF_SDL_AllocRW 67 #define SDL_FreeRW IGNORE_THIS_VERSION_OF_SDL_FreeRW 68 #define SDL_RWFromFile IGNORE_THIS_VERSION_OF_SDL_RWFromFile 69 #define SDL_RWFromFP IGNORE_THIS_VERSION_OF_SDL_RWFromFP 70 #define SDL_RWFromMem IGNORE_THIS_VERSION_OF_SDL_RWFromMem 71 #define SDL_RWFromConstMem IGNORE_THIS_VERSION_OF_SDL_RWFromConstMem 72 #define SDL_ReadLE16 IGNORE_THIS_VERSION_OF_SDL_ReadLE16 73 #define SDL_ReadBE16 IGNORE_THIS_VERSION_OF_SDL_ReadBE16 74 #define SDL_ReadLE32 IGNORE_THIS_VERSION_OF_SDL_ReadLE32 75 #define SDL_ReadBE32 IGNORE_THIS_VERSION_OF_SDL_ReadBE32 76 #define SDL_ReadLE64 IGNORE_THIS_VERSION_OF_SDL_ReadLE64 77 #define SDL_ReadBE64 IGNORE_THIS_VERSION_OF_SDL_ReadBE64 78 #define SDL_WriteLE16 IGNORE_THIS_VERSION_OF_SDL_WriteLE16 79 #define SDL_WriteBE16 IGNORE_THIS_VERSION_OF_SDL_WriteBE16 80 #define SDL_WriteLE32 IGNORE_THIS_VERSION_OF_SDL_WriteLE32 81 #define SDL_WriteBE32 IGNORE_THIS_VERSION_OF_SDL_WriteBE32 82 #define SDL_WriteLE64 IGNORE_THIS_VERSION_OF_SDL_WriteLE64 83 #define SDL_WriteBE64 IGNORE_THIS_VERSION_OF_SDL_WriteBE64 84 #define SDL_GetThreadID IGNORE_THIS_VERSION_OF_SDL_GetThreadID 85 #define SDL_ThreadID IGNORE_THIS_VERSION_OF_SDL_ThreadID 86 #define SDL_JoystickName IGNORE_THIS_VERSION_OF_SDL_JoystickName 87 #define SDL_LoadBMP_RW IGNORE_THIS_VERSION_OF_SDL_LoadBMP_RW 88 #define SDL_SaveBMP_RW IGNORE_THIS_VERSION_OF_SDL_SaveBMP_RW 89 #define SDL_LoadWAV_RW IGNORE_THIS_VERSION_OF_SDL_LoadWAV_RW 90 #define SDL_UpperBlit IGNORE_THIS_VERSION_OF_SDL_UpperBlit 91 #define SDL_LowerBlit IGNORE_THIS_VERSION_OF_SDL_LowerBlit 92 #define SDL_SoftStretch IGNORE_THIS_VERSION_OF_SDL_SoftStretch 93 #define SDL_ConvertSurface IGNORE_THIS_VERSION_OF_SDL_ConvertSurface 94 #define SDL_SetColorKey IGNORE_THIS_VERSION_OF_SDL_SetColorKey 95 #define SDL_LockSurface IGNORE_THIS_VERSION_OF_SDL_LockSurface 96 #define SDL_UnlockSurface IGNORE_THIS_VERSION_OF_SDL_UnlockSurface 97 #define SDL_GetKeyName IGNORE_THIS_VERSION_OF_SDL_GetKeyName 98 #define SDL_VideoInit IGNORE_THIS_VERSION_OF_SDL_VideoInit 99 #define SDL_BuildAudioCVT IGNORE_THIS_VERSION_OF_SDL_BuildAudioCVT 100 #define SDL_ConvertAudio IGNORE_THIS_VERSION_OF_SDL_ConvertAudio 101 #define SDL_RegisterApp IGNORE_THIS_VERSION_OF_SDL_RegisterApp 102 #define SDL_UnregisterApp IGNORE_THIS_VERSION_OF_SDL_UnregisterApp 103 104 /* *** HACK HACK HACK: 105 * *** Avoid including SDL_thread.h: it defines SDL_CreateThread() as a macro */ 106 #if defined(_WIN32) || defined(__OS2__) 107 #define _SDL_thread_h 108 #define SDL_thread_h_ 109 #define SDL_PASSED_BEGINTHREAD_ENDTHREAD 110 #endif 111 #ifdef __OS2__ 112 #define INCL_DOSMODULEMGR /* for Dos_LoadModule() & co. */ 113 #endif 114 115 #define __BUILDING_SDL12_COMPAT__ 1 116 #include "SDL.h" 117 #include "SDL_syswm.h" /* includes windows.h for _WIN32, os2.h for __OS2__ */ 118 119 /* Headers from SDL2 >= 2.0.7 needed for SDL_AudioStream: 120 */ 121 #if !SDL_VERSION_ATLEAST(2,0,7) 122 #error You need to compile against SDL >= 2.0.7 headers. 123 #endif 124 125 /* Missing SDL_thread.h stuff (see above): */ 126 #if defined(_WIN32) || defined(__OS2__) 127 typedef struct SDL_Thread SDL_Thread; 128 typedef int (SDLCALL *SDL_ThreadFunction) (void*); 129 #endif 130 #ifdef __OS2__ 131 typedef int (*pfnSDL_CurrentBeginThread) (void (*func)(void*), void*, unsigned, void*); 132 typedef void (*pfnSDL_CurrentEndThread) (void); 133 #endif 134 #ifdef _WIN32 135 typedef UINT_PTR (__cdecl *pfnSDL_CurrentBeginThread) 136 (void*, unsigned, unsigned (__stdcall *func)(void*), void*, unsigned, unsigned*); 137 typedef void (__cdecl *pfnSDL_CurrentEndThread) (unsigned); 138 /* the following macros from Win32 SDK headers are harmful here: */ 139 #undef CreateThread 140 #undef CreateSemaphore 141 #undef CreateMutex 142 #endif /* _WIN32 */ 143 144 #undef SDL_Log 145 #undef SDL_GetVersion 146 #undef SDL_ReportAssertion 147 #undef SDL_Error 148 #undef SDL_SetError 149 #undef SDL_PollEvent 150 #undef SDL_PushEvent 151 #undef SDL_EventState 152 #undef SDL_PeepEvents 153 #undef SDL_WaitEvent 154 #undef SDL_SetEventFilter 155 #undef SDL_GetEventFilter 156 #undef SDL_CreateRGBSurface 157 #undef SDL_CreateRGBSurfaceFrom 158 #undef SDL_FreeSurface 159 #undef SDL_SetClipRect 160 #undef SDL_GetClipRect 161 #undef SDL_FillRect 162 #undef SDL_GetRGB 163 #undef SDL_GetRGBA 164 #undef SDL_MapRGB 165 #undef SDL_MapRGBA 166 #undef SDL_CreateCursor 167 #undef SDL_SetCursor 168 #undef SDL_GetCursor 169 #undef SDL_FreeCursor 170 #undef SDL_UpdateRect 171 #undef SDL_UpdateRects 172 #undef SDL_GetMouseState 173 #undef SDL_GetRelativeMouseState 174 #undef SDL_GL_SetAttribute 175 #undef SDL_GL_GetAttribute 176 #undef SDL_CreateThread 177 #undef SDL_AddTimer 178 #undef SDL_RemoveTimer 179 #undef SDL_AllocRW 180 #undef SDL_FreeRW 181 #undef SDL_RWFromFile 182 #undef SDL_RWFromFP 183 #undef SDL_RWFromMem 184 #undef SDL_RWFromConstMem 185 #undef SDL_ReadLE16 186 #undef SDL_ReadBE16 187 #undef SDL_ReadLE32 188 #undef SDL_ReadBE32 189 #undef SDL_ReadLE64 190 #undef SDL_ReadBE64 191 #undef SDL_WriteLE16 192 #undef SDL_WriteBE16 193 #undef SDL_WriteLE32 194 #undef SDL_WriteBE32 195 #undef SDL_WriteLE64 196 #undef SDL_WriteBE64 197 #undef SDL_GetThreadID 198 #undef SDL_ThreadID 199 #undef SDL_JoystickName 200 #undef SDL_LoadBMP_RW 201 #undef SDL_SaveBMP_RW 202 #undef SDL_LoadWAV_RW 203 #undef SDL_UpperBlit 204 #undef SDL_LowerBlit 205 #undef SDL_SoftStretch 206 #undef SDL_ConvertSurface 207 #undef SDL_SetColorKey 208 #undef SDL_LockSurface 209 #undef SDL_UnlockSurface 210 #undef SDL_GetKeyName 211 #undef SDL_VideoInit 212 #undef SDL_BuildAudioCVT 213 #undef SDL_ConvertAudio 214 #undef SDL_RegisterApp 215 #undef SDL_UnregisterApp 216 217 #ifdef SDL_mutexP 218 #undef SDL_mutexP 219 #endif 220 221 #ifdef SDL_mutexV 222 #undef SDL_mutexV 223 #endif 224 225 #ifdef SDL_BlitSurface 226 #undef SDL_BlitSurface 227 #endif 228 229 #ifdef SDL_malloc 230 #undef SDL_malloc 231 #endif 232 233 #ifdef SDL_calloc 234 #undef SDL_calloc 235 #endif 236 237 #ifdef SDL_realloc 238 #undef SDL_realloc 239 #endif 240 241 #ifdef SDL_free 242 #undef SDL_free 243 #endif 244 245 #ifdef SDL_getenv 246 #undef SDL_getenv 247 #endif 248 249 #ifdef SDL_qsort 250 #undef SDL_qsort 251 #endif 252 253 #ifdef SDL_memset 254 #undef SDL_memset 255 #endif 256 257 #ifdef SDL_memcpy 258 #undef SDL_memcpy 259 #endif 260 261 #ifdef SDL_revcpy 262 #undef SDL_revcpy 263 #endif 264 265 #ifdef SDL_memcmp 266 #undef SDL_memcmp 267 #endif 268 269 #ifdef SDL_strlen 270 #undef SDL_strlen 271 #endif 272 273 #ifdef SDL_strlcpy 274 #undef SDL_strlcpy 275 #endif 276 277 #ifdef SDL_strlcat 278 #undef SDL_strlcat 279 #endif 280 281 #ifdef SDL_strdup 282 #undef SDL_strdup 283 #endif 284 285 #ifdef SDL_strrev 286 #undef SDL_strrev 287 #endif 288 289 #ifdef SDL_strupr 290 #undef SDL_strupr 291 #endif 292 293 #ifdef SDL_strlwr 294 #undef SDL_strlwr 295 #endif 296 297 #ifdef SDL_strchr 298 #undef SDL_strchr 299 #endif 300 301 #ifdef SDL_strrchr 302 #undef SDL_strrchr 303 #endif 304 305 #ifdef SDL_strstr 306 #undef SDL_strstr 307 #endif 308 309 #ifdef SDL_ltoa 310 #undef SDL_ltoa 311 #endif 312 313 #ifdef SDL_ultoa 314 #undef SDL_ultoa 315 #endif 316 317 #ifdef SDL_strtol 318 #undef SDL_strtol 319 #endif 320 321 #ifdef SDL_strtoul 322 #undef SDL_strtoul 323 #endif 324 325 #ifdef SDL_lltoa 326 #undef SDL_lltoa 327 #endif 328 329 #ifdef SDL_ulltoa 330 #undef SDL_ulltoa 331 #endif 332 333 #ifdef SDL_strtoll 334 #undef SDL_strtoll 335 #endif 336 337 #ifdef SDL_strtoull 338 #undef SDL_strtoull 339 #endif 340 341 #ifdef SDL_strtod 342 #undef SDL_strtod 343 #endif 344 345 #ifdef SDL_strcmp 346 #undef SDL_strcmp 347 #endif 348 349 #ifdef SDL_strncmp 350 #undef SDL_strncmp 351 #endif 352 353 #ifdef SDL_strcasecmp 354 #undef SDL_strcasecmp 355 #endif 356 357 #ifdef SDL_strncasecmp 358 #undef SDL_strncasecmp 359 #endif 360 361 #ifdef SDL_sscanf 362 #undef SDL_sscanf 363 #endif 364 365 #ifdef SDL_snprintf 366 #undef SDL_snprintf 367 #endif 368 369 #ifdef SDL_vsnprintf 370 #undef SDL_vsnprintf 371 #endif 372 373 #ifdef SDL_iconv_open 374 #undef SDL_iconv_open 375 #endif 376 377 #ifdef SDL_iconv_close 378 #undef SDL_iconv_close 379 #endif 380 381 #ifdef SDL_iconv 382 #undef SDL_iconv 383 #endif 384 385 #ifdef SDL_iconv_string 386 #undef SDL_iconv_string 387 #endif 388 389 #ifdef SDL_atoi 390 #undef SDL_atoi 391 #endif 392 393 #ifdef SDL_setenv 394 #undef SDL_setenv 395 #endif 396 397 #endif 398 399 /* vi: set ts=4 sw=4 expandtab: */ 400 401