mirror of
https://github.com/encounter/SDL.git
synced 2025-12-12 14:46:19 +00:00
configuration updates for dlopen:
- cmake, configure (CheckDLOPEN): --enable-sdl-dlopen is now history.. detach the dl api discovery from SDL_LOADSO_DLOPEN functionality. define HAVE_DLOPEN. also define DYNAPI_NEEDS_DLOPEN (CheckDLOPEN is called only for relevant platforms.) - update SDL_config.in and SDL_config.cmake accordingly. - SDL_dynapi.h: set SDL_DYNAMIC_API to 0 if DYNAPI_NEEDS_DLOPEN is defined, but HAVE_DLOPEN is not. - pthread/SDL_systhread.c: conditionalize dl api use to HAVE_DLOPEN - SDL_x11opengl.c, SDL_DirectFB_opengl.c, SDL_naclopengles.c: rely on HAVE_DLOPEN, not SDL_LOADSO_DLOPEN. - SDL_config_android.h, SDL_config_iphoneos.h, SDL_config_macosx.h, SDL_config_pandora.h, and SDL_config_wiz.h: define HAVE_DLOPEN. Closes: https://github.com/libsdl-org/SDL/pull/4351
This commit is contained in:
committed by
Sam Lantinga
parent
cb0fd05eeb
commit
77c8d11137
@@ -47,7 +47,7 @@ struct SDL_GLDriverData
|
||||
};
|
||||
|
||||
#define OPENGL_REQUIRS_DLOPEN
|
||||
#if defined(OPENGL_REQUIRS_DLOPEN) && defined(SDL_LOADSO_DLOPEN)
|
||||
#if defined(OPENGL_REQUIRS_DLOPEN) && defined(HAVE_DLOPEN)
|
||||
#include <dlfcn.h>
|
||||
#define GL_LoadObject(X) dlopen(X, (RTLD_NOW|RTLD_GLOBAL))
|
||||
#define GL_LoadFunction dlsym
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "SDL_video.h"
|
||||
#include "SDL_naclvideo.h"
|
||||
|
||||
#if SDL_LOADSO_DLOPEN
|
||||
#ifdef HAVE_DLOPEN
|
||||
#include "dlfcn.h"
|
||||
#endif
|
||||
|
||||
@@ -45,7 +45,7 @@ NACL_GLES_LoadLibrary(_THIS, const char *path)
|
||||
void *
|
||||
NACL_GLES_GetProcAddress(_THIS, const char *proc)
|
||||
{
|
||||
#if SDL_LOADSO_DLOPEN
|
||||
#ifdef HAVE_DLOPEN
|
||||
return dlsym( 0 /* RTLD_DEFAULT */, proc);
|
||||
#else
|
||||
return NULL;
|
||||
|
||||
@@ -142,7 +142,7 @@ typedef GLXContext(*PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display * dpy,
|
||||
#endif
|
||||
|
||||
#define OPENGL_REQUIRES_DLOPEN
|
||||
#if defined(OPENGL_REQUIRES_DLOPEN) && defined(SDL_LOADSO_DLOPEN)
|
||||
#if defined(OPENGL_REQUIRES_DLOPEN) && defined(HAVE_DLOPEN)
|
||||
#include <dlfcn.h>
|
||||
#define GL_LoadObject(X) dlopen(X, (RTLD_NOW|RTLD_GLOBAL))
|
||||
#define GL_LoadFunction dlsym
|
||||
@@ -174,7 +174,7 @@ X11_GL_LoadLibrary(_THIS, const char *path)
|
||||
}
|
||||
_this->gl_config.dll_handle = GL_LoadObject(path);
|
||||
if (!_this->gl_config.dll_handle) {
|
||||
#if defined(OPENGL_REQUIRES_DLOPEN) && defined(SDL_LOADSO_DLOPEN)
|
||||
#if defined(OPENGL_REQUIRES_DLOPEN) && defined(HAVE_DLOPEN)
|
||||
SDL_SetError("Failed loading %s: %s", path, dlerror());
|
||||
#endif
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user