src/loadso/dlopen/SDL_sysloadso.c
changeset 10372 19b0437c4099
parent 9998 f67cf37e9cd4
child 10737 3406a0f8b041
equal deleted inserted replaced
10371:155d4f094f62 10372:19b0437c4099
    28 #include <stdio.h>
    28 #include <stdio.h>
    29 #include <dlfcn.h>
    29 #include <dlfcn.h>
    30 
    30 
    31 #include "SDL_loadso.h"
    31 #include "SDL_loadso.h"
    32 
    32 
       
    33 #if SDL_VIDEO_DRIVER_UIKIT
       
    34 #include "../../video/uikit/SDL_uikitvideo.h"
       
    35 #endif
       
    36 
    33 void *
    37 void *
    34 SDL_LoadObject(const char *sofile)
    38 SDL_LoadObject(const char *sofile)
    35 {
    39 {
    36     void *handle = dlopen(sofile, RTLD_NOW|RTLD_LOCAL);
    40     void *handle;
    37     const char *loaderror = (char *) dlerror();
    41     const char *loaderror;
       
    42 
       
    43 #if SDL_VIDEO_DRIVER_UIKIT
       
    44     if (!UIKit_IsSystemVersionAtLeast(8.0)) {
       
    45         SDL_SetError("SDL_LoadObject requires iOS 8+");
       
    46         return NULL;
       
    47     }
       
    48 #endif
       
    49 
       
    50     handle = dlopen(sofile, RTLD_NOW|RTLD_LOCAL);
       
    51     loaderror = (char *) dlerror();
    38     if (handle == NULL) {
    52     if (handle == NULL) {
    39         SDL_SetError("Failed loading %s: %s", sofile, loaderror);
    53         SDL_SetError("Failed loading %s: %s", sofile, loaderror);
    40     }
    54     }
    41     return (handle);
    55     return (handle);
    42 }
    56 }