Mercurial > sdl-ios-xcode
comparison src/video/x11/SDL_x11dyn.c @ 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 | b966761fef6c |
comparison
equal
deleted
inserted
replaced
3957:b1d5b56aa549 | 3958:85b6fb6a5e3c |
---|---|
70 *fn = SDL_LoadFunction(x11libs[i].lib, fnname); | 70 *fn = SDL_LoadFunction(x11libs[i].lib, fnname); |
71 if (*fn != NULL) | 71 if (*fn != NULL) |
72 break; | 72 break; |
73 } | 73 } |
74 } | 74 } |
75 | |
76 if (*fn != NULL) | |
77 SDL_ClearError(); | |
78 else | |
79 SDL_SetError("Failed to load function %s from x11libs", fnname); | |
80 | 75 |
81 #if DEBUG_DYNAMIC_X11 | 76 #if DEBUG_DYNAMIC_X11 |
82 if (*fn != NULL) | 77 if (*fn != NULL) |
83 printf("X11: Found '%s' in %s (%p)\n", fnname, x11libs[i].libname, *fn); | 78 printf("X11: Found '%s' in %s (%p)\n", fnname, x11libs[i].libname, *fn); |
84 else | 79 else |
168 | 163 |
169 #ifdef X_HAVE_UTF8_STRING | 164 #ifdef X_HAVE_UTF8_STRING |
170 X11_GetSym("XCreateIC",&SDL_X11_HAVE_UTF8,(void **)&pXCreateIC); | 165 X11_GetSym("XCreateIC",&SDL_X11_HAVE_UTF8,(void **)&pXCreateIC); |
171 #endif | 166 #endif |
172 | 167 |
173 if (!SDL_X11_HAVE_BASEXLIB) { /* some required symbol didn't load. */ | 168 if (SDL_X11_HAVE_BASEXLIB) { /* all required symbols loaded. */ |
169 SDL_ClearError(); | |
170 } else { | |
174 SDL_X11_UnloadSymbols(); /* in case something got loaded... */ | 171 SDL_X11_UnloadSymbols(); /* in case something got loaded... */ |
175 rc = 0; | 172 rc = 0; |
176 } | 173 } |
177 } | 174 } |
178 #else | 175 #else |