changeset 3958:85b6fb6a5e3c SDL-1.2

Actually, this is a better fix...clear the error state once if everything we need loaded; it's more efficient, and works even if the last unnecessary xrandr symbol failed to load. Otherwise, leave the original loadso error, so the end user can find out what symbol failed.
author Ryan C. Gordon <icculus@icculus.org>
date Wed, 13 Jun 2007 08:00:10 +0000
parents b1d5b56aa549
children 33c248ea75f9
files src/video/x11/SDL_x11dyn.c
diffstat 1 files changed, 3 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/video/x11/SDL_x11dyn.c	Wed Jun 13 07:54:10 2007 +0000
+++ b/src/video/x11/SDL_x11dyn.c	Wed Jun 13 08:00:10 2007 +0000
@@ -73,11 +73,6 @@
 		}
 	}
 
-	if (*fn != NULL)
-		SDL_ClearError();
-	else
-		SDL_SetError("Failed to load function %s from x11libs", fnname);
-
 	#if DEBUG_DYNAMIC_X11
 	if (*fn != NULL)
 		printf("X11: Found '%s' in %s (%p)\n", fnname, x11libs[i].libname, *fn);
@@ -170,7 +165,9 @@
 		X11_GetSym("XCreateIC",&SDL_X11_HAVE_UTF8,(void **)&pXCreateIC);
 		#endif
 
-		if (!SDL_X11_HAVE_BASEXLIB) {  /* some required symbol didn't load. */
+		if (SDL_X11_HAVE_BASEXLIB) {  /* all required symbols loaded. */
+			SDL_ClearError();
+		} else {
 			SDL_X11_UnloadSymbols();  /* in case something got loaded... */
 			rc = 0;
 		}