Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated dynamic X11 support... #101

Closed
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Closed

Updated dynamic X11 support... #101

SDLBugzilla opened this issue Feb 10, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 1.2
Reported for operating system, platform: Linux, x86

Comments on the original bug report:

On 2006-03-21 19:34:14 +0000, Ryan C. Gordon wrote:

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.

On 2006-03-21 19:34:49 +0000, Ryan C. Gordon wrote:

Created attachment 87
Updated dynamic X11 patch.

On 2006-03-21 23:56:19 +0000, Sam Lantinga wrote:

Looks good, go for it!

On 2006-03-22 00:01:57 +0000, Ryan C. Gordon wrote:

Committed to CVS.

--ryan.

On 2006-03-22 00:17:42 +0000, Sam Lantinga wrote:

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"

On 2006-03-22 03:55:19 +0000, Ryan C. Gordon wrote:

Checking..

--ryan.

On 2006-03-22 03:57:53 +0000, Ryan C. Gordon wrote:

Should be fixed in CVS now. Let me know if it's still broken.

--ryan.

sezero added a commit to sezero/SDL that referenced this issue May 10, 2024
Noticed this in SDL-1.2 in a gcc-13 build, which emitted the following
warning:  (No such warnings in SDL2 and SDL3, due to macro differences)

./src/video/x11/SDL_x11sym.h:84:48: warning: argument 2 of type 'char *' declared as a pointer [-Warray-parameter=]
   84 | SDL_X11_SYM(int,XQueryKeymap,(Display* a,char *b),(a,b),return)
      |                                          ~~~~~~^
./src/video/x11/SDL_x11dyn.c:95:15: note: in definition of macro 'SDL_X11_SYM'
   95 |         rc fn params { ret p##fn args ; }
      |               ^~~~~~
In file included from ./src/video/x11/SDL_x11dyn.h:27,
                 from ./src/video/x11/SDL_x11dyn.c:26:
/usr/include/X11/Xlib.h:2980:5: note: previously declared as an array 'char[32]'
 2980 |     char [32]           /* keys_return */
      |     ^~~~~~~~~

The original actually was char[32] but was changed with
libsdl-org/SDL-1.2@8ada1e8
(https://bugzilla.libsdl.org/show_bug.cgi?id=170
libsdl-org/SDL-1.2#101)
sezero added a commit to libsdl-org/SDL that referenced this issue May 10, 2024
Noticed this in SDL-1.2 in a gcc-13 build, which emitted the following
warning:  (No such warnings in SDL2 and SDL3, due to macro differences)

./src/video/x11/SDL_x11sym.h:84:48: warning: argument 2 of type 'char *' declared as a pointer [-Warray-parameter=]
   84 | SDL_X11_SYM(int,XQueryKeymap,(Display* a,char *b),(a,b),return)
      |                                          ~~~~~~^
./src/video/x11/SDL_x11dyn.c:95:15: note: in definition of macro 'SDL_X11_SYM'
   95 |         rc fn params { ret p##fn args ; }
      |               ^~~~~~
In file included from ./src/video/x11/SDL_x11dyn.h:27,
                 from ./src/video/x11/SDL_x11dyn.c:26:
/usr/include/X11/Xlib.h:2980:5: note: previously declared as an array 'char[32]'
 2980 |     char [32]           /* keys_return */
      |     ^~~~~~~~~

The original actually was char[32] but was changed with
libsdl-org/SDL-1.2@8ada1e8
(https://bugzilla.libsdl.org/show_bug.cgi?id=170
libsdl-org/SDL-1.2#101)
sezero added a commit to libsdl-org/SDL that referenced this issue May 10, 2024
Noticed this in SDL-1.2 in a gcc-13 build, which emitted the following
warning:  (No such warnings in SDL2 and SDL3, due to macro differences)

./src/video/x11/SDL_x11sym.h:84:48: warning: argument 2 of type 'char *' declared as a pointer [-Warray-parameter=]
   84 | SDL_X11_SYM(int,XQueryKeymap,(Display* a,char *b),(a,b),return)
      |                                          ~~~~~~^
./src/video/x11/SDL_x11dyn.c:95:15: note: in definition of macro 'SDL_X11_SYM'
   95 |         rc fn params { ret p##fn args ; }
      |               ^~~~~~
In file included from ./src/video/x11/SDL_x11dyn.h:27,
                 from ./src/video/x11/SDL_x11dyn.c:26:
/usr/include/X11/Xlib.h:2980:5: note: previously declared as an array 'char[32]'
 2980 |     char [32]           /* keys_return */
      |     ^~~~~~~~~

The original actually was char[32] but was changed with
libsdl-org/SDL-1.2@8ada1e8
(https://bugzilla.libsdl.org/show_bug.cgi?id=170
libsdl-org/SDL-1.2#101)

(cherry picked from commit b2fca55)
sezero added a commit that referenced this issue May 10, 2024
Fixes a gcc-13 -Warray-parameter warning:

./src/video/x11/SDL_x11sym.h:84:48: warning: argument 2 of type 'char *' declared as a pointer [-Warray-parameter=]
   84 | SDL_X11_SYM(int,XQueryKeymap,(Display* a,char *b),(a,b),return)
      |                                          ~~~~~~^
./src/video/x11/SDL_x11dyn.c:95:15: note: in definition of macro 'SDL_X11_SYM'
   95 |         rc fn params { ret p##fn args ; }
      |               ^~~~~~
In file included from ./src/video/x11/SDL_x11dyn.h:27,
                 from ./src/video/x11/SDL_x11dyn.c:26:
/usr/include/X11/Xlib.h:2980:5: note: previously declared as an array 'char[32]'
 2980 |     char [32]           /* keys_return */
      |     ^~~~~~~~~

The original actually was char[32] but was changed with
8ada1e8
(https://bugzilla.libsdl.org/show_bug.cgi?id=170
#101)

Backport from SDL3 commit b2fca55e5cf38599b3f20438509bf00b93db37b3
sezero added a commit to sezero/SDL that referenced this issue May 11, 2024
Noticed this in SDL-1.2 in a gcc-13 build, which emitted the following
warning:  (No such warnings in SDL2 and SDL3, due to macro differences)

./src/video/x11/SDL_x11sym.h:84:48: warning: argument 2 of type 'char *' declared as a pointer [-Warray-parameter=]
   84 | SDL_X11_SYM(int,XQueryKeymap,(Display* a,char *b),(a,b),return)
      |                                          ~~~~~~^
./src/video/x11/SDL_x11dyn.c:95:15: note: in definition of macro 'SDL_X11_SYM'
   95 |         rc fn params { ret p##fn args ; }
      |               ^~~~~~
In file included from ./src/video/x11/SDL_x11dyn.h:27,
                 from ./src/video/x11/SDL_x11dyn.c:26:
/usr/include/X11/Xlib.h:2980:5: note: previously declared as an array 'char[32]'
 2980 |     char [32]           /* keys_return */
      |     ^~~~~~~~~

The original actually was char[32] but was changed with
libsdl-org/SDL-1.2@8ada1e8
(https://bugzilla.libsdl.org/show_bug.cgi?id=170
libsdl-org/SDL-1.2#101)

(cherry picked from commit b2fca55)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant