Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Fix compilation with libX11 >= 1.5.99.902.

These changes fixes bug #1769 for SDL2
(http://bugzilla.libsdl.org/show_bug.cgi?id=1769).
  • Loading branch information
winterheart committed Jun 2, 2013
1 parent b8f173f commit 8cc816829d4edc042b8c60c8617a20677a284a5a
Showing with 55 additions and 0 deletions.
  1. +8 −0 cmake/sdlchecks.cmake
  2. +29 −0 configure
  3. +12 −0 configure.in
  4. +1 −0 include/SDL_config.h.cmake
  5. +1 −0 include/SDL_config.h.in
  6. +4 −0 src/video/x11/SDL_x11sym.h
@@ -356,6 +356,14 @@ macro(CheckX11)
set(SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1)
endif(HAVE_XGENERICEVENT)

check_c_source_compiles("
#include <X11/Xlibint.h>
extern int _XData32(Display *dpy,register _Xconst long *data,unsigned len);
int main(int argc, char **argv) {}" HAVE_CONST_XDATA32)
if(HAVE_CONST_XDATA32)
set(SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 1)
endif(HAVE_CONST_XDATA32)

check_function_exists(XkbKeycodeToKeysym SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM)

if(VIDEO_X11_XCURSOR AND HAVE_XCURSOR_H)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_const_param_XextAddDisplay" >&5
$as_echo "$have_const_param_XextAddDisplay" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for const parameter to _XData32" >&5
$as_echo_n "checking for const parameter to _XData32... " >&6; }
have_const_param_xdata32=no
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

#include <X11/Xlibint.h>
extern int _XData32(Display *dpy,register _Xconst long *data,unsigned len);

int
main ()
{


;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :

have_const_param_xdata32=yes
$as_echo "#define SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 1" >>confdefs.h


fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_const_param_xdata32" >&5
$as_echo "$have_const_param_xdata32" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XGenericEvent" >&5
$as_echo_n "checking for XGenericEvent... " >&6; }
have_XGenericEvent=no
@@ -1144,6 +1144,18 @@ AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=ma
])
AC_MSG_RESULT($have_const_param_XextAddDisplay)

AC_MSG_CHECKING(for const parameter to _XData32)
have_const_param_xdata32=no
AC_TRY_COMPILE([
#include <X11/Xlibint.h>
extern int _XData32(Display *dpy,register _Xconst long *data,unsigned len);
],[
],[
have_const_param_xdata32=yes
AC_DEFINE(SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32)
])
AC_MSG_RESULT($have_const_param_xdata32)

dnl AC_CHECK_LIB(X11, XGetEventData, AC_DEFINE(SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS, 1, [Have XGenericEvent]))
AC_MSG_CHECKING([for XGenericEvent])
have_XGenericEvent=no
@@ -266,6 +266,7 @@
#cmakedefine SDL_VIDEO_DRIVER_X11_XSHAPE @SDL_VIDEO_DRIVER_X11_XSHAPE@
#cmakedefine SDL_VIDEO_DRIVER_X11_XVIDMODE @SDL_VIDEO_DRIVER_X11_XVIDMODE@
#cmakedefine SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS @SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS@
#cmakedefine SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 @SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32@
#cmakedefine SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY @SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY@
#cmakedefine SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM @SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM@

@@ -268,6 +268,7 @@
#undef SDL_VIDEO_DRIVER_X11_XSHAPE
#undef SDL_VIDEO_DRIVER_X11_XVIDMODE
#undef SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS
#undef SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32
#undef SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY
#undef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM

@@ -203,7 +203,11 @@ SDL_X11_SYM(Bool,XShmQueryExtension,(Display* a),(a),return)
*/
#ifdef LONG64
SDL_X11_MODULE(IO_32BIT)
#if SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32
SDL_X11_SYM(int,_XData32,(Display *dpy,register _Xconst long *data,unsigned len),(dpy,data,len),return)
#else
SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return)
#endif
SDL_X11_SYM(void,_XRead32,(Display *dpy,register long *data,long len),(dpy,data,len),)
#endif

0 comments on commit 8cc8168

Please sign in to comment.