Error removal patch for SDL_x11dyn.c

I found that calling SDL_GetError when an error hasn’t necessarily occurred is
still reporting problems from loadso regarding dynamic functions in X11. I’ve
added the following to my local copy to avoid revealing the ‘many library
lookup’ approach adopted by x11dyn.c:

— SDL_x11dyn.c 2006-06-27 00:48:30.000000000 -0400
+++ SDL_x11dyn_noerr.c 2007-06-04 01:17:55.346938146 -0400
@@ -73,6 +73,11 @@
}
}

  •   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);

Hope this makes its way in.

-George

I found that calling SDL_GetError when an error hasn’t necessarily occurred is
still reporting problems from loadso regarding dynamic functions in X11. I’ve
added the following to my local copy to avoid revealing the ‘many library
lookup’ approach adopted by x11dyn.c:

Something roughly like this just went into Subversion (revision #3064
for 1.2, #3065 for 1.3).

If anyone finds more cases where we’re setting error messages for APIs
that succeed in this way, let me know…there are probably a lot of
these in SDL, and it will take a long time to weed them all out, but it
would be nice to fix them all over time.

–ryan.