Skip to content

Commit af317e2

Browse files
committed
Update error.c from gnulib.
1 parent db162eb commit af317e2

File tree

4 files changed

+281
-64
lines changed

4 files changed

+281
-64
lines changed

ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2003-05-09 Bruno Haible <bruno@clisp.org>
2+
3+
* srclib/error.c: Update from gnulib with modifications.
4+
* m4/strerror_r.m4: New file, from gnulib.
5+
* Makefile.devel (aclocal.m4): Depend on it.
6+
17
2003-05-08 Bruno Haible <bruno@clisp.org>
28

39
* Makefile.msvc (IIPREFIX): New variable.

Makefile.devel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ CONFIGURES_IN = configure.in
4444
#m4/endian.m4 : $(CLISP_DIR)/src/m4/endian.m4 ; cp -p $< $@-t && mv $@-t $@
4545
#m4/libtool.m4 : $(CLISP_DIR)/src/m4/libtool.m4 ; cp -p $< $@-t && mv $@-t $@
4646

47-
aclocal.m4 : m4/general.m4 m4/proto.m4 m4/cp.m4 m4/ln.m4 m4/codeset.m4 m4/eilseq.m4 m4/endian.m4 m4/glibc21.m4 m4/isc-posix.m4 m4/lcmessage.m4 m4/alloca.m4 m4/canonicalize.m4 m4/error.m4 m4/mbstate_t.m4 m4/onceonly.m4 m4/pathmax.m4 m4/relocatable.m4 m4/setenv.m4 m4/stdbool.m4 m4/strerror.m4 m4/xreadlink.m4 m4/libtool.m4 m4/gettext.m4 m4/iconv.m4 m4/lib-ld.m4 m4/lib-link.m4 m4/lib-prefix.m4 m4/nls.m4 m4/po.m4 m4/progtest.m4
47+
aclocal.m4 : m4/general.m4 m4/proto.m4 m4/cp.m4 m4/ln.m4 m4/codeset.m4 m4/eilseq.m4 m4/endian.m4 m4/glibc21.m4 m4/isc-posix.m4 m4/lcmessage.m4 m4/alloca.m4 m4/canonicalize.m4 m4/error.m4 m4/mbstate_t.m4 m4/onceonly.m4 m4/pathmax.m4 m4/relocatable.m4 m4/setenv.m4 m4/stdbool.m4 m4/strerror.m4 m4/strerror_r.m4 m4/xreadlink.m4 m4/libtool.m4 m4/gettext.m4 m4/iconv.m4 m4/lib-ld.m4 m4/lib-link.m4 m4/lib-prefix.m4 m4/nls.m4 m4/po.m4 m4/progtest.m4
4848
aclocal -I m4 --output=$@
4949

5050
configures : $(CONFIGURES)

m4/strerror_r.m4

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#serial 1003
2+
# Experimental replacement for the function in the latest CVS autoconf.
3+
# Use with the error.c file in ../lib.
4+
5+
# Copyright 2001 Free Software Foundation, Inc.
6+
7+
# This program is free software; you can redistribute it and/or modify
8+
# it under the terms of the GNU General Public License as published by
9+
# the Free Software Foundation; either version 2, or (at your option)
10+
# any later version.
11+
12+
# This program is distributed in the hope that it will be useful,
13+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
# GNU General Public License for more details.
16+
17+
# You should have received a copy of the GNU General Public License
18+
# along with this program; if not, write to the Free Software Foundation,
19+
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
20+
21+
undefine([AC_FUNC_STRERROR_R])
22+
23+
# AC_FUNC_STRERROR_R
24+
# ------------------
25+
AC_DEFUN([AC_FUNC_STRERROR_R],
26+
[AC_CHECK_DECLS([strerror_r])
27+
AC_CHECK_FUNCS([strerror_r])
28+
AC_CACHE_CHECK([whether strerror_r returns char *],
29+
ac_cv_func_strerror_r_char_p,
30+
[
31+
ac_cv_func_strerror_r_char_p=no
32+
if test $ac_cv_have_decl_strerror_r = yes; then
33+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
34+
[[
35+
char buf[100];
36+
char x = *strerror_r (0, buf, sizeof buf);
37+
char *p = strerror_r (0, buf, sizeof buf);
38+
]])],
39+
ac_cv_func_strerror_r_char_p=yes)
40+
else
41+
# strerror_r is not declared. Choose between
42+
# systems that have relatively inaccessible declarations for the
43+
# function. BeOS and DEC UNIX 4.0 fall in this category, but the
44+
# former has a strerror_r that returns char*, while the latter
45+
# has a strerror_r that returns `int'.
46+
# This test should segfault on the DEC system.
47+
AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT
48+
extern char *strerror_r ();],
49+
[[char buf[100];
50+
char x = *strerror_r (0, buf, sizeof buf);
51+
exit (!isalpha (x));]])],
52+
ac_cv_func_strerror_r_char_p=yes, , :)
53+
fi
54+
])
55+
if test $ac_cv_func_strerror_r_char_p = yes; then
56+
AC_DEFINE([STRERROR_R_CHAR_P], 1,
57+
[Define to 1 if strerror_r returns char *.])
58+
fi
59+
])# AC_FUNC_STRERROR_R

0 commit comments

Comments
 (0)