]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* acfunctions.m4 (AC_FUNC_STRERROR_R): Update to
authorAkim Demaille <akim@epita.fr>
Mon, 19 Mar 2001 11:22:10 +0000 (11:22 +0000)
committerAkim Demaille <akim@epita.fr>
Mon, 19 Mar 2001 11:22:10 +0000 (11:22 +0000)
fileutils-4.0.42's.

ChangeLog
acfunctions.m4
doc/autoconf.texi
lib/autoconf/functions.m4

index bb2883ac1ff784f1f5cd9bf15fa2168b9757ef9e..a43a69a1827f4c1aa859dbb5ae511a9264232b93 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-03-19  Akim Demaille  <akim@epita.fr>
+
+       * acfunctions.m4 (AC_FUNC_STRERROR_R): Update to
+       fileutils-4.0.42's.
+
 2001-03-19  Akim Demaille  <akim@epita.fr>
 
        * tests/atgeneral.m4 (AT_INIT): Don't always create `empty', rather
index 048027d60af6dbe1406c6503e133239110935b3e..f9bc873214cdb4efa78c861e94f1563e2e1f389c 100644 (file)
@@ -1283,7 +1283,8 @@ fi
 # AC_FUNC_STRERROR_R
 # ------------------
 AC_DEFUN([AC_FUNC_STRERROR_R],
-[AC_CHECK_FUNCS([strerror_r])
+[AC_CHECK_DECLS([strerror_r])
+AC_CHECK_FUNCS([strerror_r])
 if test $ac_cv_func_strerror_r = yes; then
   AC_CHECK_HEADERS(string.h)
   AC_CACHE_CHECK([for working strerror_r],
@@ -1297,14 +1298,42 @@ if test $ac_cv_func_strerror_r = yes; then
 #       endif
      ],
      [
-       char buf;
-       char x = *strerror_r (0, &buf, sizeof buf);
+       char buf[100];
+       char x = *strerror_r (0, buf, sizeof buf);
      ],
      ac_cv_func_strerror_r_works=yes,
      ac_cv_func_strerror_r_works=no
-    )])
+    )
+    if test $ac_cv_func_strerror_r_works = no; then
+      # strerror_r seems not to work, but now we have to choose between
+      # systems that have relatively inaccessible declarations for the
+      # function.  BeOS and DEC UNIX 4.0 fall in this category, but the
+      # former has a strerror_r that returns char*, while the latter
+      # has a strerror_r that returns `int'.
+      # This test should segfault on the DEC system.
+      AC_TRY_RUN(
+       [
+#       include <stdio.h>
+#       include <string.h>
+#       include <ctype.h>
+
+       extern char *strerror_r ();
+
+       int
+       main ()
+       {
+         char buf[100];
+         char x = *strerror_r (0, buf, sizeof buf);
+         exit (!isalpha (x));
+       }
+       ],
+       ac_cv_func_strerror_r_works=yes,
+       ac_cv_func_strerror_r_works=no,
+       ac_cv_func_strerror_r_works=no)
+    fi
+  ])
   if test $ac_cv_func_strerror_r_works = yes; then
-    AC_DEFINE_UNQUOTED(HAVE_WORKING_STRERROR_R, 1,
+    AC_DEFINE_UNQUOTED([HAVE_WORKING_STRERROR_R], 1,
                        [Define to 1 if `strerror_r' returns a string.])
   fi
 fi
index 338a074a47d65c18112341c8b86c811600efbcc0..e49fd1becfab6874e649c37bb1eac0988d78b895 100644 (file)
@@ -55,8 +55,8 @@ This file documents the GNU Autoconf package for creating scripts to
 configure source code packages using templates and an @code{m4} macro
 package.
 
-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000 Free Software
-Foundation, Inc.
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free
+Software Foundation, Inc.
 
 Permission is granted to make and distribute verbatim copies of this
 manual provided the copyright notice and this permission notice are
@@ -90,8 +90,8 @@ approved by the Foundation.
 
 @page
 @vskip 0pt plus 1filll
-Copyright @copyright{} 1992, 93, 94, 95, 96, 98, 99, 2000 Free Software
-Foundation, Inc.
+Copyright @copyright{} 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000,
+2001 Free Software Foundation, Inc.
 
 Permission is granted to make and distribute verbatim copies of this
 manual provided the copyright notice and this permission notice are
index 048027d60af6dbe1406c6503e133239110935b3e..f9bc873214cdb4efa78c861e94f1563e2e1f389c 100644 (file)
@@ -1283,7 +1283,8 @@ fi
 # AC_FUNC_STRERROR_R
 # ------------------
 AC_DEFUN([AC_FUNC_STRERROR_R],
-[AC_CHECK_FUNCS([strerror_r])
+[AC_CHECK_DECLS([strerror_r])
+AC_CHECK_FUNCS([strerror_r])
 if test $ac_cv_func_strerror_r = yes; then
   AC_CHECK_HEADERS(string.h)
   AC_CACHE_CHECK([for working strerror_r],
@@ -1297,14 +1298,42 @@ if test $ac_cv_func_strerror_r = yes; then
 #       endif
      ],
      [
-       char buf;
-       char x = *strerror_r (0, &buf, sizeof buf);
+       char buf[100];
+       char x = *strerror_r (0, buf, sizeof buf);
      ],
      ac_cv_func_strerror_r_works=yes,
      ac_cv_func_strerror_r_works=no
-    )])
+    )
+    if test $ac_cv_func_strerror_r_works = no; then
+      # strerror_r seems not to work, but now we have to choose between
+      # systems that have relatively inaccessible declarations for the
+      # function.  BeOS and DEC UNIX 4.0 fall in this category, but the
+      # former has a strerror_r that returns char*, while the latter
+      # has a strerror_r that returns `int'.
+      # This test should segfault on the DEC system.
+      AC_TRY_RUN(
+       [
+#       include <stdio.h>
+#       include <string.h>
+#       include <ctype.h>
+
+       extern char *strerror_r ();
+
+       int
+       main ()
+       {
+         char buf[100];
+         char x = *strerror_r (0, buf, sizeof buf);
+         exit (!isalpha (x));
+       }
+       ],
+       ac_cv_func_strerror_r_works=yes,
+       ac_cv_func_strerror_r_works=no,
+       ac_cv_func_strerror_r_works=no)
+    fi
+  ])
   if test $ac_cv_func_strerror_r_works = yes; then
-    AC_DEFINE_UNQUOTED(HAVE_WORKING_STRERROR_R, 1,
+    AC_DEFINE_UNQUOTED([HAVE_WORKING_STRERROR_R], 1,
                        [Define to 1 if `strerror_r' returns a string.])
   fi
 fi