| Summary: | libX11-1.4.99.1 adds _XGetRequest symbol which SDL must define too | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Petr Pisar <ppisar> |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P1 | CC: | adnan.kuleta |
| Version: | HG 1.2 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: |
Fix
Better fix. |
||
|
Description
Petr Pisar
2012-01-17 05:58:18 UTC
Gah, Ryan, how did we handle optional X11 symbol resolution again? (In reply to comment #1) > Gah, Ryan, how did we handle optional X11 symbol resolution again? Doh, let me look into this. --ryan. Created attachment 780 [details] Better fix. Attachment #779 [details] forgot the "return" keyword on the macro, and would fail if used on an older Xlib that lacks this symbol because it's listed as part of base X11. This patch should load the symbol, and deal with old systems without the symbol when building SDL with the newer headers. It was really irresponsible of the Xlib developers to break binary compatibility like this. --ryan. Let me ask: (1) Does the return keyword mean SDL returns immediately instead of calling the function from libX11? If do, then why _XFlushGCCache is missing the keyword: SDL_X11_SYM(void,_XFlushGCCache,(Display* a,GC b),(a,b),) I did not find the `_XFlushGCCache' anywhere else in the SDL code, thus I think it's not used by SDL. (2) Also you check for SDL_X11_HAVE_XGETREQUEST, but #define SDL_X11_MODULE(modname) extern int SDL_X11_HAVE_##modname; SDL_X11_SYM(void *,_XGetRequest,(Display* a,CARD8 b,size_t c),(a,b,c),return) should create SDL_X11_HAVE__XGetRequest symbol (double underscore). Should you check for SDL_X11_HAVE__XGETREQUEST? (In reply to comment #4) > (1) Does the return keyword mean SDL returns immediately instead of calling the > function from libX11? If do, then why _XFlushGCCache is missing the keyword: > > SDL_X11_SYM(void,_XFlushGCCache,(Display* a,GC b),(a,b),) The "return" is needed if the function doesn't return "void" ... it's a requirement of this macro trick. > I did not find the `_XFlushGCCache' anywhere else in the SDL code, thus I think > it's not used by SDL. It's used by the FlushGC macro, which the Xv support code uses. > (2) Also you check for SDL_X11_HAVE_XGETREQUEST, but > > #define SDL_X11_MODULE(modname) extern int SDL_X11_HAVE_##modname; > SDL_X11_SYM(void *,_XGetRequest,(Display* a,CARD8 b,size_t c),(a,b,c),return) > > should create SDL_X11_HAVE__XGetRequest symbol (double underscore). Should you > check for SDL_X11_HAVE__XGETREQUEST? No, it looks for whatever we specified for "modname" in SDL_X11_MODULE, which was "XGETREQUEST". --ryan. Petr, can you try out the attached patch and see if it works for you? Thanks! Current SDL-1.2 head compiles with the old libX11 as well as with the new libX11. After applying the patch to SDL-1.2.14, it compiles and works with old libX11. It compiles and works with new libX11. Great, thanks! Hi, Can anyone tell me and help me how to patch SDL librarz? regards (In reply to comment #9) > Can anyone tell me and help me how to patch SDL librarz? > If you have SDL-1.2.15, you do need to apply this patch because it's already included. If you have SDL-1.2.14, you need to adjust the patch before applying as it has been created against development SDL tree. Or you can get rebased patch from some distribution archives like this one from Fedora <http://pkgs.fedoraproject.org/cgit/SDL.git/plain/SDL-1.2.14-Define__XGetRequest.patch?id=600a62015f44deed7a5e1340a7097157cbf210fe>. |