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. --HG-- branch : SDL-1.2 extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%402342
This commit is contained in:
parent
7bcb619015
commit
3c92462fd1
1 changed files with 3 additions and 6 deletions
|
@ -73,11 +73,6 @@ static void X11_GetSym(const char *fnname, int *rc, void **fn)
|
|||
}
|
||||
}
|
||||
|
||||
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 @@ int SDL_X11_LoadSymbols(void)
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue