Skip to content

Commit

Permalink
OS/2: proper fix for dynapi (thanks, Ozkan!).
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Aug 25, 2017
1 parent 685890a commit 2213077
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/dynapi/SDL_dynapi.c
Expand Up @@ -24,6 +24,12 @@

#if SDL_DYNAMIC_API

#if defined(__OS2__)
#define INCL_DOS
#define INCL_DOSERRORS
#include <dos.h>
#endif

#include "SDL.h"

/* !!! FIXME: Shouldn't these be included in SDL.h? */
Expand Down Expand Up @@ -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 <dos.h>
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);
}
}
Expand Down

0 comments on commit 2213077

Please sign in to comment.