bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

strings.h on MSVC


From: Bruno Haible
Subject: strings.h on MSVC
Date: Sun, 11 Sep 2011 21:17:18 +0200
User-agent: KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; )

The MSVC compiler also has no <strings.h>. Here's a fix to avoid to
include a nonexistent header file.


2011-09-11  Bruno Haible  <address@hidden>

        strings: Don't assume <strings.h> exists.
        * lib/strings.in.h: Include <strings.h> only if HAVE_STRINGS_H is 1.
        * m4/strings_h.m4 (gl_HEADER_STRINGS_H_BODY): Set HAVE_STRINGS_H.
        * modules/strings (Makefile.am): Substitute HAVE_STRINGS_H.
        * doc/posix-headers/strings.texi: Mention the MSVC problem.

--- doc/posix-headers/strings.texi.orig Sun Sep 11 21:13:34 2011
+++ doc/posix-headers/strings.texi      Sun Sep 11 18:26:01 2011
@@ -15,6 +15,9 @@
 Portability problems not fixed by Gnulib:
 @itemize
 @item
+This header file is missing on some platforms:
+MSVC 9.
address@hidden
 This header file defines symbols, such as @samp{index}, often used for
 variables, making debugging harder.
 @end itemize
--- lib/strings.in.h.orig       Sun Sep 11 21:13:34 2011
+++ lib/strings.in.h    Sun Sep 11 18:26:01 2011
@@ -30,7 +30,9 @@
 #endif
 
 /* The include_next requires a split double-inclusion guard.  */
address@hidden@ @NEXT_STRINGS_H@
+#if @HAVE_STRINGS_H@
+# @INCLUDE_NEXT@ @NEXT_STRINGS_H@
+#endif
 
 #ifndef address@hidden@_STRINGS_H
 #define address@hidden@_STRINGS_H
--- m4/strings_h.m4.orig        Sun Sep 11 21:13:34 2011
+++ m4/strings_h.m4     Sun Sep 11 18:26:01 2011
@@ -1,5 +1,5 @@
 # Configure a replacement for <strings.h>.
-# serial 5
+# serial 6
 
 # Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
@@ -16,7 +16,14 @@
 AC_DEFUN([gl_HEADER_STRINGS_H_BODY],
 [
   AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS])
+
   gl_CHECK_NEXT_HEADERS([strings.h])
+  if test $ac_cv_header_strings_h = yes; then
+    HAVE_STRINGS_H=1
+  else
+    HAVE_STRINGS_H=0
+  fi
+  AC_SUBST([HAVE_STRINGS_H])
 
   dnl Check for declarations of anything we want to poison if the
   dnl corresponding gnulib module is not in use.
--- modules/strings.orig        Sun Sep 11 21:13:34 2011
+++ modules/strings     Sun Sep 11 18:26:01 2011
@@ -24,6 +24,7 @@
        $(AM_V_GEN)rm -f address@hidden $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
          sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
+             -e 's|@''HAVE_STRINGS_H''@|$(HAVE_STRINGS_H)|g' \
              -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \

-- 
In memoriam Georgi Markov <http://en.wikipedia.org/wiki/Georgi_Markov>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]