We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 170

Summary: Updated dynamic X11 support...
Product: SDL Reporter: Ryan C. Gordon <icculus>
Component: videoAssignee: Ryan C. Gordon <icculus>
Status: VERIFIED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 1.2   
Hardware: x86   
OS: Linux   
Attachments: Updated dynamic X11 patch.

Description Ryan C. Gordon 2006-03-21 19:34:14 UTC
Here's a shot at updating the dynamic X11 code.

- It no longer needs all code to prefix a 'p' before X calls...this makes development more natural, and makes it easy to totally remove the dynamic code if this doesn't work out. The bulk of this patch is reverting all the 'p' prefixing in the rest of the source code.
- It now keeps track of what did and did not load by "modules", so the build system may have support for, say, the UTF-8 entry points, but these can be missing on the end-user system...the basic Xlib entry points will still work in this case, but the code can check SDL_X11_HAVE_UTF8 to see if it's safe to call the functions in this module. For SDL builds linked directly against Xlib, these module checks are always true.
- Current moudles are: "BASEXLIB" for all the general, must-have functionality...the X11 target will gracefully fail to initialize if any of those symbols are missing. "UTF8" for the Unicode stuff and XIM support (we gracefully fallback to single-byte char handling if this is missing). "SHM" for the MIT Shared Memory extension support (we do without if it's not there). There are some other dummy modules for internal symbols that aren't called if they don't exist on a system, like the 32-bit IO fallbacks on amd64, etc.
- Future modules will be "XRANDR", and whatever else we don't want to link against directly. We could possibly jettison some of the included code for things like xme and Xinerama and such, too.

Let me know what you think.

--ryan.
Comment 1 Ryan C. Gordon 2006-03-21 19:34:49 UTC
Created attachment 87 [details]
Updated dynamic X11 patch.
Comment 2 Sam Lantinga 2006-03-21 23:56:19 UTC
Looks good, go for it!
Comment 3 Ryan C. Gordon 2006-03-22 00:01:57 UTC
Committed to CVS.

--ryan.

Comment 4 Sam Lantinga 2006-03-22 00:17:42 UTC
This doesn't build on 32-bit systems:
In file included from ./src/video/x11/SDL_x11dyn.c:88:
./src/video/x11/SDL_x11sym.h:164: error: syntax error before '(' token
./src/video/x11/SDL_x11sym.h:164: error: conflicting types for '_XRead'
./src/video/x11/SDL_x11sym.h:121: error: previous definition of '_XRead' was here
./src/video/x11/SDL_x11sym.h:164: error: syntax error before "char"
Comment 5 Ryan C. Gordon 2006-03-22 03:55:19 UTC
Checking..

--ryan.

Comment 6 Ryan C. Gordon 2006-03-22 03:57:53 UTC
Should be fixed in CVS now. Let me know if it's still broken.

--ryan.