Index: configure.in
===================================================================
--- configure.in	(revision 20261)
+++ configure.in	(arbetskopia)
@@ -1301,21 +1301,16 @@
   AC_CHECK_FUNC(XRenderQueryExtension, :,
                 AC_MSG_ERROR([*** libXrender not found. Check 'config.log' for more details.]))
 
-  # Check for xReply
+  # Check if <X11/extensions/XIproto.h> is needed for xReply.                
+  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_ERROR([xReply type unavailable. X11 is too old])],
+                               [[#include <X11/extensions/XIproto.h>
+                                 #include <X11/Xlibint.h>]])],
+                [[#include <X11/Xlibint.h>]])
 
-  AC_MSG_CHECKING([if <X11/extensions/XIproto.h> is needed for xReply])
-  AC_TRY_COMPILE([#include <X11/Xlibint.h>],
-      [xReply *rep;],
-      [AC_MSG_RESULT([no])],
-      [AC_TRY_COMPILE([#include <X11/extensions/XIproto.h>
-#include <X11/Xlibint.h>],
-           [xReply *rep;],
-           [AC_MSG_RESULT([yes])
-            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])])])
-
   # Check for XConvertCase, XInternAtoms (X11R6 specific)
 
   AC_CHECK_FUNCS(XConvertCase XInternAtoms)
