comparison src/video/x11/SDL_x11gl.c @ 1246:ca51a76a7328

Make error message meaningful if dlopen() fails on libX11.
author Ryan C. Gordon <icculus@icculus.org>
date Fri, 13 Jan 2006 02:32:07 +0000
parents b81f54c3963f
children ff73ee89ff4b
comparison
equal deleted inserted replaced
1245:fe7d081a4955 1246:ca51a76a7328
464 int dlopen_flags = RTLD_LAZY | RTLD_GLOBAL; 464 int dlopen_flags = RTLD_LAZY | RTLD_GLOBAL;
465 #else 465 #else
466 int dlopen_flags = RTLD_LAZY; 466 int dlopen_flags = RTLD_LAZY;
467 #endif 467 #endif
468 handle = dlopen(path, dlopen_flags); 468 handle = dlopen(path, dlopen_flags);
469 if ( handle == NULL ) {
470 SDL_SetError("Could not load OpenGL library: %s", (const char *) dlerror());
471 return -1;
472 }
469 } 473 }
470 #else 474 #else
471 handle = SDL_LoadObject(path); 475 handle = SDL_LoadObject(path);
476 if ( handle == NULL ) {
477 SDL_SetError("Could not load OpenGL library");
478 return -1;
479 }
472 #endif 480 #endif
473 481
474 if ( handle == NULL ) {
475 SDL_SetError("Could not load OpenGL library");
476 return -1;
477 }
478 482
479 /* Unload the old driver and reset the pointers */ 483 /* Unload the old driver and reset the pointers */
480 X11_GL_UnloadLibrary(this); 484 X11_GL_UnloadLibrary(this);
481 485
482 /* Load new function pointers */ 486 /* Load new function pointers */