X11_GetSym only sets error condition, error condition is also the default

Hello list,

This is probably something I’m missing. SDL 1.3 from HG. All test
programs report “No available video device”, because
SDL_X11_LoadSymbols fails. In it, each and every SDL_X11_HAVE_* int was
set to 0.

I looked into X11_GetSym - it was doing fine, something along the lines
of

#if DEBUG_DYNAMIC_X11
if (*fn != NULL)
printf(“X11: Found ‘%s’ in %s (%p)\n”, fnname,
x11libs[i].libname, *fn);
else
printf(“X11: Symbol ‘%s’ NOT FOUND!\n”, fnname);
#endif

if (*fn == NULL)
rc = 0; / kill this module. */

}

Notice, how nothing happens on success. I understand that is correct,
as one missing symbol should fail the entire module.

However, the default is also zero:

#define SDL_X11_MODULE(modname) int SDL_X11_HAVE_##modname = 0;

I devised a lame “fix” for that:

diff -r a7142857e885 src/video/x11/SDL_x11dyn.c
— a/src/video/x11/SDL_x11dyn.c Mon Oct 24 12:07:41 2011 -0400
+++ b/src/video/x11/SDL_x11dyn.c Mon Oct 24 21:25:28 2011 +0400
@@ -176,7 +176,7 @@
x11libs[i].lib = SDL_LoadObject(x11libs[i].libname);
}
}
-#define SDL_X11_MODULE(modname) thismod = &SDL_X11_HAVE_##modname;
+#define SDL_X11_MODULE(modname) thismod = &SDL_X11_HAVE_##modname,
thismod = 1; #define SDL_X11_SYM(a,fn,x,y,z)
X11_GetSym(#fn,thismod,(void
*)&p##fn); #include “SDL_x11sym.h”
#undef SDL_X11_MODULE

This is probably something I’m missing. SDL 1.3 from HG. All test
programs report “No available video device”, because
SDL_X11_LoadSymbols fails. In it, each and every SDL_X11_HAVE_* int was
set to 0.

Whoops, I just broke this by not thinking all the way through a change.

This is fixed in revision control now, sorry about that!

–ryan.