Modernize the xReply check

Using AC_CHECK_TYPE instead of AC_TRY_COMPILE avoids compiler
warnings from -Werror.

https://bugzilla.gnome.org/show_bug.cgi?id=535929
This commit is contained in:
Matthias Clasen 2015-03-07 18:25:57 -05:00
parent 1f3328c096
commit 4938aa9c6b

View File

@ -1031,22 +1031,16 @@ if test "x$enable_x11_backend" = xyes; then
AC_CHECK_FUNC(XextFindDisplay, :,
AC_MSG_ERROR([*** libX11 and libXext not found. Check 'config.log' for more details.]))
# Check for xReply
# Check if <X11/extensions/XIproto.h> is needed for xReply.
AC_MSG_CHECKING([if <X11/extensions/XIproto.h> is needed for xReply])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlibint.h>]],
[[xReply *rep = NULL;
rep = rep;]])],
[AC_MSG_RESULT([no])],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/XIproto.h>
#include <X11/Xlibint.h>]],
[[xReply *rep = NULL;
rep = rep;]])],
[AC_MSG_RESULT([yes])
AC_DEFINE([NEED_XIPROTO_H_FOR_XREPLY], [1],
AC_CHECK_TYPE([xReply], ,
[AC_CHECK_TYPE([xReply],
[AC_DEFINE([NEED_XIPROTO_H_FOR_XREPLY], 1,
[Define if <X11/extensions/XIproto.h> needed for xReply])],
[AC_MSG_RESULT([unknown])
AC_MSG_ERROR([xReply type unavailable. X11 is too old])])])
[AC_MSG_ERROR([xReply type unavailable. X11 is too old])],
[[#include <X11/extensions/XIproto.h>
#include <X11/Xlibint.h>]])],
[[#include <X11/Xlibint.h>]])
# Check for XKB support.