From 2213077a95601f7fe9c1c2f3d90b74c4e03462cb Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 25 Aug 2017 11:31:12 -0400 Subject: [PATCH] OS/2: proper fix for dynapi (thanks, Ozkan!). --- src/dynapi/SDL_dynapi.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/dynapi/SDL_dynapi.c b/src/dynapi/SDL_dynapi.c index efb572803817e..866160b06879d 100644 --- a/src/dynapi/SDL_dynapi.c +++ b/src/dynapi/SDL_dynapi.c @@ -24,6 +24,12 @@ #if SDL_DYNAMIC_API +#if defined(__OS2__) +#define INCL_DOS +#define INCL_DOSERRORS +#include +#endif + #include "SDL.h" /* !!! FIXME: Shouldn't these be included in SDL.h? */ @@ -232,16 +238,13 @@ static SDL_INLINE void *get_sdlapi_entry(const char *fname, const char *sym) } #elif defined(__OS2__) -#define INCL_DOS -#define INCL_DOSERRORS -#include static SDL_INLINE void *get_sdlapi_entry(const char *fname, const char *sym) { HMODULE hmodule; PFN retval = NULL; char error[256]; if (NO_ERROR == DosLoadModule(&error, sizeof(error), fname, &hmodule)) { - if (NO_ERROR == DosQueryProcAddr(handle, 0, sym, &retval)) { + if (NO_ERROR == DosQueryProcAddr(hmodule, 0, sym, &retval)) { DosFreeModule(hmodule); } }