[PATCH] Conditionally include strnlen.h

Yaakov (Cygwin/X) yselkowitz at users.sourceforge.net
Tue Oct 20 17:31:34 PDT 2009


From: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>

Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
---
 configure.ac |    3 +++
 xlsclients.c |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index f665380..3b28926 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,6 +39,9 @@ AC_PROG_INSTALL
 # Check for functional strnlen
 AC_USE_SYSTEM_EXTENSIONS
 AC_FUNC_STRNLEN
+if test "x$ac_cv_func_strnlen_working" = xyes; then
+  AC_DEFINE(HAVE_STRNLEN, 1, [Define to 1 if you have a working strnlen function.])
+fi
 
 XORG_DEFAULT_OPTIONS
 
diff --git a/xlsclients.c b/xlsclients.c
index 049bc4c..2452352 100644
--- a/xlsclients.c
+++ b/xlsclients.c
@@ -37,6 +37,9 @@ in this Software without prior written authorization from The Open Group.
 #include <xcb/xcb.h>
 #include <xcb/xproto.h>
 #include <xcb/xcb_atom.h>
+#ifndef HAVE_STRNLEN
+#include "strnlen.h"
+#endif
 
 static char *ProgramName;
 
-- 
1.6.4.2



More information about the xorg-devel mailing list