dynapi: fill in OS/2 loading code (thanks, Ozkan!).
authorRyan C. Gordon <icculus@icculus.org>
Tue, 22 Aug 2017 15:50:39 -0400
changeset 113456120f75935f9
parent 11344 039ef928e200
child 11346 4d2bf1b340cd
dynapi: fill in OS/2 loading code (thanks, Ozkan!).

Partially fixes Bugzilla #3765.
src/dynapi/SDL_dynapi.c
     1.1 --- a/src/dynapi/SDL_dynapi.c	Mon Aug 21 23:44:46 2017 -0700
     1.2 +++ b/src/dynapi/SDL_dynapi.c	Tue Aug 22 15:50:39 2017 -0400
     1.3 @@ -230,6 +230,24 @@
     1.4      }
     1.5      return retval;
     1.6  }
     1.7 +
     1.8 +#elif defined(__OS2__)
     1.9 +#define INCL_DOS
    1.10 +#define INCL_DOSERRORS
    1.11 +#include <dos.h>
    1.12 +static SDL_INLINE void *get_sdlapi_entry(const char *fname, const char *sym)
    1.13 +{
    1.14 +    HMODULE hmodule;
    1.15 +    PFN retval = NULL;
    1.16 +    char error[256];
    1.17 +    if (NO_ERROR == DosLoadModule(&error, sizeof(error), fname, &hmodule)) {
    1.18 +        if (NO_ERROR == DosQueryProcAddr(handle, 0, sym, &retval)) {
    1.19 +            DosFreeModule(hmodule);
    1.20 +        }
    1.21 +    }
    1.22 +    return (void *) retval;
    1.23 +}
    1.24 +
    1.25  #else
    1.26  #error Please define your platform.
    1.27  #endif