Skip to content

Commit

Permalink
dynapi: fill in OS/2 loading code (thanks, Ozkan!).
Browse files Browse the repository at this point in the history
Partially fixes Bugzilla #3765.
  • Loading branch information
icculus committed Aug 22, 2017
1 parent 17453d4 commit a3890ff
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/dynapi/SDL_dynapi.c
Expand Up @@ -230,6 +230,24 @@ static SDL_INLINE void *get_sdlapi_entry(const char *fname, const char *sym)
}
return retval;
}

#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)) {
DosFreeModule(hmodule);
}
}
return (void *) retval;
}

#else
#error Please define your platform.
#endif
Expand Down

0 comments on commit a3890ff

Please sign in to comment.