configure/cmake/x11: Removed SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 test.
authorRyan C. Gordon <icculus@icculus.org>
Mon, 08 Jun 2015 01:13:51 -0400
changeset 9718d5955671f259
parent 9717 45a632fd9d83
child 9719 8e78db33b5de
configure/cmake/x11: Removed SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 test.

This was the only thing that made SDL_config.h generate differently between
32 and 64-bit versions of Linux, so instead we force a function cast in our
X11 code to match our dynamic loader version, which removes the compile error
on some machines that prompted this test in the first place.

Xlib never wrote to this data, so if you're on an older Xlib where this param
wasn't const, your data should still be intact when we force the caller to
think it was actually const after all.

Fixes Bugzilla #1893.
cmake/sdlchecks.cmake
configure.in
include/SDL_config.h.cmake
include/SDL_config.h.in
src/video/x11/SDL_x11dyn.c
src/video/x11/SDL_x11sym.h
     1.1 --- a/cmake/sdlchecks.cmake	Sun Jun 07 20:15:09 2015 -0400
     1.2 +++ b/cmake/sdlchecks.cmake	Mon Jun 08 01:13:51 2015 -0400
     1.3 @@ -409,14 +409,6 @@
     1.4          set(SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1)
     1.5        endif()
     1.6  
     1.7 -      check_c_source_compiles("
     1.8 -          #include <X11/Xlibint.h>
     1.9 -          extern int _XData32(Display *dpy,register _Xconst long *data,unsigned len);
    1.10 -          int main(int argc, char **argv) {}" HAVE_CONST_XDATA32)
    1.11 -      if(HAVE_CONST_XDATA32)
    1.12 -        set(SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 1)
    1.13 -      endif()
    1.14 -
    1.15        check_function_exists(XkbKeycodeToKeysym SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM)
    1.16  
    1.17        if(VIDEO_X11_XCURSOR AND HAVE_XCURSOR_H)
     2.1 --- a/configure.in	Sun Jun 07 20:15:09 2015 -0400
     2.2 +++ b/configure.in	Mon Jun 08 01:13:51 2015 -0400
     2.3 @@ -1492,18 +1492,6 @@
     2.4              ])
     2.5              AC_MSG_RESULT($have_const_param_XextAddDisplay)
     2.6  
     2.7 -            AC_MSG_CHECKING(for const parameter to _XData32)
     2.8 -	    have_const_param_xdata32=no
     2.9 -	    AC_TRY_COMPILE([
    2.10 -	      #include <X11/Xlibint.h>
    2.11 -	      extern int _XData32(Display *dpy,register _Xconst long *data,unsigned len);
    2.12 -	    ],[
    2.13 -	    ],[
    2.14 -	    have_const_param_xdata32=yes
    2.15 -	    AC_DEFINE(SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32)
    2.16 -	    ])
    2.17 -	    AC_MSG_RESULT($have_const_param_xdata32)
    2.18 -
    2.19              dnl AC_CHECK_LIB(X11, XGetEventData, AC_DEFINE(SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS, 1, [Have XGenericEvent]))
    2.20              AC_MSG_CHECKING([for XGenericEvent])
    2.21              have_XGenericEvent=no
     3.1 --- a/include/SDL_config.h.cmake	Sun Jun 07 20:15:09 2015 -0400
     3.2 +++ b/include/SDL_config.h.cmake	Mon Jun 08 01:13:51 2015 -0400
     3.3 @@ -305,7 +305,6 @@
     3.4  #cmakedefine SDL_VIDEO_DRIVER_X11_XSHAPE @SDL_VIDEO_DRIVER_X11_XSHAPE@
     3.5  #cmakedefine SDL_VIDEO_DRIVER_X11_XVIDMODE @SDL_VIDEO_DRIVER_X11_XVIDMODE@
     3.6  #cmakedefine SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS @SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS@
     3.7 -#cmakedefine SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 @SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32@
     3.8  #cmakedefine SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY @SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY@
     3.9  #cmakedefine SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM @SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM@
    3.10  
     4.1 --- a/include/SDL_config.h.in	Sun Jun 07 20:15:09 2015 -0400
     4.2 +++ b/include/SDL_config.h.in	Mon Jun 08 01:13:51 2015 -0400
     4.3 @@ -308,7 +308,6 @@
     4.4  #undef SDL_VIDEO_DRIVER_X11_XSHAPE
     4.5  #undef SDL_VIDEO_DRIVER_X11_XVIDMODE
     4.6  #undef SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS
     4.7 -#undef SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32
     4.8  #undef SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY
     4.9  #undef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM
    4.10  #undef SDL_VIDEO_DRIVER_NACL
     5.1 --- a/src/video/x11/SDL_x11dyn.c	Sun Jun 07 20:15:09 2015 -0400
     5.2 +++ b/src/video/x11/SDL_x11dyn.c	Mon Jun 08 01:13:51 2015 -0400
     5.3 @@ -207,7 +207,7 @@
     5.4  #else  /* no dynamic X11 */
     5.5  
     5.6  #define SDL_X11_MODULE(modname) SDL_X11_HAVE_##modname = 1; /* default yes */
     5.7 -#define SDL_X11_SYM(a,fn,x,y,z) X11_##fn = fn;
     5.8 +#define SDL_X11_SYM(a,fn,x,y,z) X11_##fn = (SDL_DYNX11FN_##fn) fn;
     5.9  #include "SDL_x11sym.h"
    5.10  #undef SDL_X11_MODULE
    5.11  #undef SDL_X11_SYM
     6.1 --- a/src/video/x11/SDL_x11sym.h	Sun Jun 07 20:15:09 2015 -0400
     6.2 +++ b/src/video/x11/SDL_x11sym.h	Mon Jun 08 01:13:51 2015 -0400
     6.3 @@ -203,11 +203,7 @@
     6.4   */
     6.5  #ifdef LONG64
     6.6  SDL_X11_MODULE(IO_32BIT)
     6.7 -#if SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32
     6.8  SDL_X11_SYM(int,_XData32,(Display *dpy,register _Xconst long *data,unsigned len),(dpy,data,len),return)
     6.9 -#else
    6.10 -SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return)
    6.11 -#endif
    6.12  SDL_X11_SYM(void,_XRead32,(Display *dpy,register long *data,long len),(dpy,data,len),)
    6.13  #endif
    6.14