]> Savannah Git Hosting - gnulib.git/commitdiff
Fix conflict between strerror_r-posix module and AC_FUNC_STRERROR_R.
authorBruno Haible <bruno@clisp.org>
Sun, 16 Oct 2016 15:45:52 +0000 (17:45 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 26 Oct 2016 11:58:25 +0000 (13:58 +0200)
* m4/strerror_r.m4 (gl_FUNC_STRERROR_R): Override the values set by the
AC_FUNC_STRERROR_R macro. Define HAVE_DECL_STRERROR_R_ORIG.
* lib/strerror_r.c: Use HAVE_DECL_STRERROR_R_ORIG instead of
HAVE_DECL_STRERROR_R.

ChangeLog
lib/strerror_r.c
m4/strerror_r.m4

index 4faf8ba17d75d024ffb444462acc724e4f33b34d..f01affc2deed24a7bca2b8916617394a58165373 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2016-10-16  Bruno Haible  <bruno@clisp.org>
+
+       Fix conflict between strerror_r-posix module and AC_FUNC_STRERROR_R.
+       * m4/strerror_r.m4 (gl_FUNC_STRERROR_R): Override the values set by the
+       AC_FUNC_STRERROR_R macro. Define HAVE_DECL_STRERROR_R_ORIG.
+       * lib/strerror_r.c: Use HAVE_DECL_STRERROR_R_ORIG instead of
+       HAVE_DECL_STRERROR_R.
+
 2016-10-16  Bruno Haible  <bruno@clisp.org>
 
        Make the 'argp' module work without the 'error' module.
index 07a00cf6637f05d7b64b26c66bc67925c250fc3a..b1d4cf590938851a6e44e429e8e7895b6932589d 100644 (file)
@@ -40,7 +40,7 @@ extern
 #endif
 int __xpg_strerror_r (int errnum, char *buf, size_t buflen);
 
-#elif HAVE_DECL_STRERROR_R && !(__GLIBC__ >= 2 || defined __UCLIBC__ || defined __CYGWIN__)
+#elif HAVE_DECL_STRERROR_R_ORIG && !(__GLIBC__ >= 2 || defined __UCLIBC__ || defined __CYGWIN__)
 
 /* The system's strerror_r function is OK, except that its third argument
    is 'int', not 'size_t', or its return type is wrong.  */
index 2318927961c01e5fa16d950500c177fea05d32d9..06c51e156fdeb0cc4d8df80d2aef31629fd4e967 100644 (file)
@@ -1,4 +1,4 @@
-# strerror_r.m4 serial 15
+# strerror_r.m4 serial 16
 dnl Copyright (C) 2002, 2007-2016 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -18,6 +18,8 @@ AC_DEFUN([gl_FUNC_STRERROR_R],
   if test $ac_cv_have_decl_strerror_r = no; then
     HAVE_DECL_STRERROR_R=0
   fi
+  AC_DEFINE_UNQUOTED([HAVE_DECL_STRERROR_R_ORIG], [$HAVE_DECL_STRERROR_R],
+    [Define to 1 if you have the declaration of 'strerror_r' in the system include files, or to 0 otherwise.])
 
   if test $ac_cv_func_strerror_r = yes; then
     if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
@@ -36,6 +38,11 @@ AC_DEFUN([gl_FUNC_STRERROR_R],
       REPLACE_STRERROR_R=1
     fi
   fi
+
+  # Overwrite the findings of AC_FUNC_STRERROR_R (for code that uses that).
+  AC_REQUIRE([AC_FUNC_STRERROR_R])
+  AC_DEFINE([HAVE_DECL_STRERROR_R], [1])
+  AC_DEFINE([STRERROR_R_CHAR_P], [0])
 ])
 
 # Prerequisites of lib/strerror_r.c.