[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: Updating AC_FUNC_STRERROR_R
From: |
Akim Demaille |
Subject: |
FYI: Updating AC_FUNC_STRERROR_R |
Date: |
19 Mar 2001 12:32:04 +0100 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Cuyahoga Valley) |
Index: ChangeLog
from Akim Demaille <address@hidden>
* acfunctions.m4 (AC_FUNC_STRERROR_R): Update to
fileutils-4.0.42's.
Index: acfunctions.m4
===================================================================
RCS file: /cvs/autoconf/acfunctions.m4,v
retrieving revision 1.30
diff -u -u -r1.30 acfunctions.m4
--- acfunctions.m4 2001/02/05 10:16:32 1.30
+++ acfunctions.m4 2001/03/19 11:20:00
@@ -1283,7 +1283,8 @@
# 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 @@
# 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: doc/autoconf.texi
===================================================================
RCS file: /cvs/autoconf/doc/autoconf.texi,v
retrieving revision 1.432
diff -u -u -r1.432 autoconf.texi
--- doc/autoconf.texi 2001/03/13 12:34:49 1.432
+++ doc/autoconf.texi 2001/03/19 11:20:14
@@ -55,8 +55,8 @@
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 @@
@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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- FYI: Updating AC_FUNC_STRERROR_R,
Akim Demaille <=