[Commits] SDL: The #define was asking to use dlopen(), but the code wasn't...
libsdl.org revision control
commits-owner at libsdl.org
Sat Jan 7 21:05:38 PST 2012
details: http://hg.libsdl.org/SDL/rev/6d9a266e04bb
changeset: 6183:6d9a266e04bb
user: Sam Lantinga <slouken at libsdl.org>
date: Sat Jan 07 21:02:39 2012 -0800
description:
The #define was asking to use dlopen(), but the code wasn't doing it.
Also added error message in case the library open failed in that case.
diffstat:
src/video/x11/SDL_x11opengl.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diffs (27 lines):
diff -r eb6796f3e598 -r 6d9a266e04bb src/video/x11/SDL_x11opengl.c
--- a/src/video/x11/SDL_x11opengl.c Sat Jan 07 21:01:33 2012 -0800
+++ b/src/video/x11/SDL_x11opengl.c Sat Jan 07 21:02:39 2012 -0800
@@ -82,8 +82,8 @@
*attrib_list);
#endif
-#define OPENGL_REQUIRS_DLOPEN
-#if defined(OPENGL_REQUIRS_DLOPEN) && defined(SDL_LOADSO_DLOPEN)
+#define OPENGL_REQUIRES_DLOPEN
+#if defined(OPENGL_REQUIRES_DLOPEN) && defined(SDL_LOADSO_DLOPEN)
#include <dlfcn.h>
#define GL_LoadObject(X) dlopen(X, (RTLD_NOW|RTLD_GLOBAL))
#define GL_LoadFunction dlsym
@@ -109,8 +109,11 @@
if (path == NULL) {
path = DEFAULT_OPENGL;
}
- _this->gl_config.dll_handle = SDL_LoadObject(path);
+ _this->gl_config.dll_handle = GL_LoadObject(path);
if (!_this->gl_config.dll_handle) {
+#if defined(OPENGL_REQUIRES_DLOPEN) && defined(SDL_LOADSO_DLOPEN)
+ SDL_SetError("Failed loading %s: %s", path, dlerror());
+#endif
return -1;
}
SDL_strlcpy(_this->gl_config.driver_path, path,
More information about the commits
mailing list