File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -440,19 +440,24 @@ extern SDL_NORETURN void SDL_ExitProcess(int exitcode);
440440
441441static void SDL_InitDynamicAPILocked (void )
442442{
443+ SDL_DYNAPI_ENTRYFN entry = NULL ; /* funcs from here by default. */
444+ SDL_bool use_internal = SDL_TRUE ;
445+
443446 /* this can't use SDL_getenv_REAL, because it might allocate memory before the app can set their allocator */
444447#if defined(WIN32 ) || defined(_WIN32 ) || defined(__CYGWIN__ )
445448 /* We've always used LoadLibraryA for this, so this has never worked with Unicode paths on Windows. Sorry. */
446449 char envbuf [512 ]; /* overflows will just report as environment variable being unset, but LoadLibraryA has a MAX_PATH of 260 anyhow, apparently. */
447450 const DWORD rc = GetEnvironmentVariableA (SDL_DYNAMIC_API_ENVVAR , envbuf , (DWORD ) sizeof (envbuf ));
448451 char * libname = ((rc != 0 ) && (rc < sizeof (envbuf ))) ? envbuf : NULL ;
452+ #elif defined(__OS2__ )
453+ char * libname ;
454+ if (DosScanEnv (SDL_DYNAMIC_API_ENVVAR , & libname ) != NO_ERROR ) {
455+ libname = NULL ;
456+ }
449457#else
450458 char * libname = getenv (SDL_DYNAMIC_API_ENVVAR );
451459#endif
452460
453- SDL_DYNAPI_ENTRYFN entry = NULL ; /* funcs from here by default. */
454- SDL_bool use_internal = SDL_TRUE ;
455-
456461 if (libname ) {
457462 while (* libname && !entry ) {
458463 char * ptr = libname ;
You can’t perform that action at this time.
0 commit comments