strings: Add support for Minix.
authorBruno Haible <bruno@clisp.org>
Sun, 31 Jul 2011 21:03:25 +0000 (23:03 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 31 Jul 2011 21:03:25 +0000 (23:03 +0200)
* lib/strings.in.h [Minix]: Include <sys/types.h> before <strings.h>.
* m4/strings_h.m4 (gl_HEADER_STRINGS_H_BODY): Likewise.
* doc/posix-headers/strings.texi: Document the Minix problem.

ChangeLog
doc/posix-headers/strings.texi
lib/strings.in.h
m4/strings_h.m4

index b95959c0354f8986b3032e1e4c9f2f0f48f2683c..54311c4db1aafcd55e80b37a78c0e622f0421b4b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-07-31  Bruno Haible  <bruno@clisp.org>
+
+       strings: Add support for Minix.
+       * lib/strings.in.h [Minix]: Include <sys/types.h> before <strings.h>.
+       * m4/strings_h.m4 (gl_HEADER_STRINGS_H_BODY): Likewise.
+       * doc/posix-headers/strings.texi: Document the Minix problem.
+
 2011-07-31  Bruno Haible  <bruno@clisp.org>
 
        wctype-h: Add support for Minix.
index 54e944edc4138be8130eb7b09f6bc365f646efe2..7a4619e4e930b8a9c1a35af5cf33000b5a697b8f 100644 (file)
@@ -7,6 +7,9 @@ Gnulib module: strings
 
 Portability problems fixed by Gnulib:
 @itemize
+@item
+This header file is not self-contained on some platforms:
+Minix 3.1.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 647903ad6a3f94a621203a58b4814667e58d523c..a82b2d4c21efdbb9e14ca8fe17f41b067b995f4c 100644 (file)
 #endif
 @PRAGMA_COLUMNS@
 
+/* Minix 3.1.8 has a bug: <sys/types.h> must be included before <strings.h>.
+   But avoid namespace pollution on glibc systems.  */
+#if defined __minix && !defined __GLIBC__
+# include <sys/types.h>
+#endif
+
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_STRINGS_H@
 
index 512cb9baf0eef8151b4df3d73f1cf3fd3ef0f2f1..12ca5eb4a2ed1fdcaf25d5f761a0a36d1c6ceb0e 100644 (file)
@@ -1,5 +1,5 @@
 # Configure a replacement for <strings.h>.
-# serial 4
+# serial 5
 
 # Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
@@ -20,7 +20,11 @@ AC_DEFUN([gl_HEADER_STRINGS_H_BODY],
 
   dnl Check for declarations of anything we want to poison if the
   dnl corresponding gnulib module is not in use.
-  gl_WARN_ON_USE_PREPARE([[#include <strings.h>
+  gl_WARN_ON_USE_PREPARE([[
+    /* Minix 3.1.8 has a bug: <sys/types.h> must be included before
+       <strings.h>.  */
+    #include <sys/types.h>
+    #include <strings.h>
     ]], [ffs strcasecmp strncasecmp])
 ])