From: Akim Demaille Date: Thu, 27 Sep 2001 14:25:57 +0000 (+0000) Subject: Port quotearg fixes from tar 1.13.24. X-Git-Tag: BISON-1_29c~14 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/cae30a7df418756ab40132b74f822664fde043d4?ds=inline Port quotearg fixes from tar 1.13.24. * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct tm to be declared. (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC. (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT. * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4. * m4/mbrtowc.m4: New file. * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h. Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc). --- diff --git a/ChangeLog b/ChangeLog index de23e6f8..d27cbe4f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2001-09-27 Paul Eggert + + Port quotearg fixes from tar 1.13.24. + + * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct + tm to be declared. + (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC. + (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT. + + * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4. + * m4/mbrtowc.m4: New file. + * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h. + Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc). + 2001-09-27 Akim Demaille Bump to 1.29c. diff --git a/Makefile.in b/Makefile.in index e053875a..a98b28f2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -153,7 +153,7 @@ $(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): configure.in m4/c-bs-a.m4 m4/codeset.m4 m4/dmalloc.m4 m4/error.m4 m4/gettext.m4 m4/glibc21.m4 m4/iconv.m4 m4/isc-posix.m4 m4/lcmessage.m4 m4/m4.m4 m4/malloc.m4 m4/mbstate_t.m4 m4/prereq.m4 m4/progtest.m4 m4/realloc.m4 m4/strerror_r.m4 m4/warning.m4 +$(ACLOCAL_M4): configure.in m4/c-bs-a.m4 m4/codeset.m4 m4/dmalloc.m4 m4/error.m4 m4/gettext.m4 m4/glibc21.m4 m4/iconv.m4 m4/isc-posix.m4 m4/lcmessage.m4 m4/m4.m4 m4/malloc.m4 m4/mbrtowc.m4 m4/mbstate_t.m4 m4/prereq.m4 m4/progtest.m4 m4/realloc.m4 m4/strerror_r.m4 m4/warning.m4 cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h @if test ! -f $@; then \ diff --git a/aclocal.m4 b/aclocal.m4 index 01cda9d2..b525a5e7 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -788,21 +788,41 @@ AC_DEFUN(jm_FUNC_REALLOC, fi ]) -#serial 1 +#serial 2 dnl These are the prerequisite macros for files in the lib/ dnl directories of Bison. AC_DEFUN([jm_PREREQ_QUOTEARG], [ - AC_CHECK_FUNCS(isascii iswprint mbrtowc) - AC_CHECK_HEADERS(limits.h stdlib.h string.h wchar.h wctype.h) + AC_CHECK_FUNCS(isascii iswprint mbsinit) + jm_FUNC_MBRTOWC + AC_CHECK_HEADERS(limits.h stddef.h stdlib.h string.h wchar.h wctype.h) AC_HEADER_STDC AC_C_BACKSLASH_A AC_MBSTATE_T AM_C_PROTOTYPES ]) +#serial 4 + +dnl From Paul Eggert + +AC_DEFUN([jm_FUNC_MBRTOWC], +[ + AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared], + jm_cv_func_mbrtowc, + [AC_TRY_LINK( + [#include ], + [mbstate_t state; return ! (sizeof state && mbrtowc);], + jm_cv_func_mbrtowc=yes, + jm_cv_func_mbrtowc=no)]) + if test $jm_cv_func_mbrtowc = yes; then + AC_DEFINE(HAVE_MBRTOWC, 1, + [Define to 1 if mbrtowc and mbstate_t are properly declared.]) + fi +]) + #serial 3 dnl From Paul Eggert. diff --git a/config.hin b/config.hin index b38aa387..5181d21f 100644 --- a/config.hin +++ b/config.hin @@ -113,9 +113,12 @@ /* Define if you have the header file. */ #undef HAVE_MALLOC_H -/* Define if you have the `mbrtowc' function. */ +/* Define to 1 if mbrtowc and mbstate_t are properly declared. */ #undef HAVE_MBRTOWC +/* Define if you have the `mbsinit' function. */ +#undef HAVE_MBSINIT + /* Define if you have the `memchr' function. */ #undef HAVE_MEMCHR diff --git a/configure b/configure index 395fa0eb..0f854ecb 100755 --- a/configure +++ b/configure @@ -5245,7 +5245,7 @@ _ACEOF fi -for ac_func in isascii iswprint mbrtowc +for ac_func in isascii iswprint mbsinit do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -5320,7 +5320,60 @@ _ACEOF fi done -for ac_header in limits.h stdlib.h string.h wchar.h wctype.h + echo "$as_me:$LINENO: checking whether mbrtowc and mbstate_t are properly declared" >&5 +echo $ECHO_N "checking whether mbrtowc and mbstate_t are properly declared... $ECHO_C" >&6 +if test "${jm_cv_func_mbrtowc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +mbstate_t state; return ! (sizeof state && mbrtowc); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + jm_cv_func_mbrtowc=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +jm_cv_func_mbrtowc=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $jm_cv_func_mbrtowc" >&5 +echo "${ECHO_T}$jm_cv_func_mbrtowc" >&6 + if test $jm_cv_func_mbrtowc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_MBRTOWC 1 +_ACEOF + + fi + +for ac_header in limits.h stddef.h stdlib.h string.h wchar.h wctype.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then diff --git a/lib/quotearg.c b/lib/quotearg.c index 2a7ba4c4..ca42365e 100644 --- a/lib/quotearg.c +++ b/lib/quotearg.c @@ -63,6 +63,11 @@ #endif #if HAVE_WCHAR_H + +/* BSD/OS 4.1 wchar.h requires FILE and struct tm to be declared. */ +# include +# include + # include #endif @@ -73,8 +78,12 @@ # undef MB_CUR_MAX # define MB_CUR_MAX 1 # define mbrtowc(pwc, s, n, ps) ((*(pwc) = *(s)) != 0) -# define mbsinit(ps) 1 # define iswprint(wc) ISPRINT ((unsigned char) (wc)) +# undef HAVE_MBSINIT +#endif + +#if !defined mbsinit && !HAVE_MBSINIT +# define mbsinit(ps) 1 #endif #ifndef iswprint diff --git a/m4/Makefile.am b/m4/Makefile.am index a476511c..261cc7d8 100644 --- a/m4/Makefile.am +++ b/m4/Makefile.am @@ -11,6 +11,7 @@ isc-posix.m4 \ lcmessage.m4 \ m4.m4 \ malloc.m4 \ +mbrtowc.m4 \ mbstate_t.m4 \ prereq.m4 \ progtest.m4 \ diff --git a/m4/Makefile.in b/m4/Makefile.in index 479108ff..2a84be77 100644 --- a/m4/Makefile.in +++ b/m4/Makefile.in @@ -108,6 +108,7 @@ isc-posix.m4 \ lcmessage.m4 \ m4.m4 \ malloc.m4 \ +mbrtowc.m4 \ mbstate_t.m4 \ prereq.m4 \ progtest.m4 \ diff --git a/m4/prereq.m4 b/m4/prereq.m4 index f7114268..9595967a 100644 --- a/m4/prereq.m4 +++ b/m4/prereq.m4 @@ -1,12 +1,13 @@ -#serial 1 +#serial 2 dnl These are the prerequisite macros for files in the lib/ dnl directories of Bison. AC_DEFUN([jm_PREREQ_QUOTEARG], [ - AC_CHECK_FUNCS(isascii iswprint mbrtowc) - AC_CHECK_HEADERS(limits.h stdlib.h string.h wchar.h wctype.h) + AC_CHECK_FUNCS(isascii iswprint mbsinit) + jm_FUNC_MBRTOWC + AC_CHECK_HEADERS(limits.h stddef.h stdlib.h string.h wchar.h wctype.h) AC_HEADER_STDC AC_C_BACKSLASH_A AC_MBSTATE_T diff --git a/po/de.gmo b/po/de.gmo index d5d8f412..8922daef 100644 Binary files a/po/de.gmo and b/po/de.gmo differ diff --git a/po/de.po b/po/de.po index 48585152..e1e2fb78 100644 --- a/po/de.po +++ b/po/de.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: bison 1.25\n" -"POT-Creation-Date: 2001-09-27 10:55+0200\n" +"POT-Creation-Date: 2001-09-27 16:21+0200\n" "PO-Revision-Date: 1996-10-10 17:54 MET DST\n" "Last-Translator: Ulrich Drepper \n" "Language-Team: German \n" @@ -794,11 +794,11 @@ msgstr "%s: Hauptspeicher ersch #. MARK). A British English Unicode locale should instead #. translate these to U+2018 (LEFT SINGLE QUOTATION MARK) and #. U+2019 (RIGHT SINGLE QUOTATION MARK), respectively. -#: lib/quotearg.c:259 +#: lib/quotearg.c:268 msgid "`" msgstr "" -#: lib/quotearg.c:260 +#: lib/quotearg.c:269 msgid "'" msgstr "" diff --git a/po/es.po b/po/es.po index ba35da29..846b001a 100644 --- a/po/es.po +++ b/po/es.po @@ -30,7 +30,7 @@ msgid "" msgstr "" "Project-Id-Version: GNU bison 1.25\n" -"POT-Creation-Date: 2001-09-27 10:55+0200\n" +"POT-Creation-Date: 2001-09-27 16:21+0200\n" "PO-Revision-Date: 1998-09-21 10:19+0200\n" "Last-Translator: Nicolás García-Pedrajas \n" "Language-Team: Spanish \n" @@ -924,11 +924,11 @@ msgstr "%s: memoria agotada\n" #. MARK). A British English Unicode locale should instead #. translate these to U+2018 (LEFT SINGLE QUOTATION MARK) and #. U+2019 (RIGHT SINGLE QUOTATION MARK), respectively. -#: lib/quotearg.c:259 +#: lib/quotearg.c:268 msgid "`" msgstr "" -#: lib/quotearg.c:260 +#: lib/quotearg.c:269 msgid "'" msgstr "" diff --git a/po/et.gmo b/po/et.gmo index 16b93061..bd412685 100644 Binary files a/po/et.gmo and b/po/et.gmo differ diff --git a/po/et.po b/po/et.po index befa9b98..8151749d 100644 --- a/po/et.po +++ b/po/et.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: bison 1.28d\n" -"POT-Creation-Date: 2001-09-27 10:55+0200\n" +"POT-Creation-Date: 2001-09-27 16:21+0200\n" "PO-Revision-Date: 2001-08-29 17:06+02:00\n" "Last-Translator: Toomas Soome \n" "Language-Team: Estonian \n" @@ -783,11 +783,11 @@ msgstr "m #. MARK). A British English Unicode locale should instead #. translate these to U+2018 (LEFT SINGLE QUOTATION MARK) and #. U+2019 (RIGHT SINGLE QUOTATION MARK), respectively. -#: lib/quotearg.c:259 +#: lib/quotearg.c:268 msgid "`" msgstr "`" -#: lib/quotearg.c:260 +#: lib/quotearg.c:269 msgid "'" msgstr "'" diff --git a/po/fr.gmo b/po/fr.gmo index cbe95f01..8fa1d0ca 100644 Binary files a/po/fr.gmo and b/po/fr.gmo differ diff --git a/po/fr.po b/po/fr.po index 96739e0d..3a0e3ed2 100644 --- a/po/fr.po +++ b/po/fr.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: GNU bison 1.28d\n" -"POT-Creation-Date: 2001-09-27 10:55+0200\n" +"POT-Creation-Date: 2001-09-27 16:21+0200\n" "PO-Revision-Date: 2001-08-29 20:00-0500\n" "Last-Translator: Michel Robitaille \n" "Language-Team: French \n" @@ -790,11 +790,11 @@ msgstr "m #. MARK). A British English Unicode locale should instead #. translate these to U+2018 (LEFT SINGLE QUOTATION MARK) and #. U+2019 (RIGHT SINGLE QUOTATION MARK), respectively. -#: lib/quotearg.c:259 +#: lib/quotearg.c:268 msgid "`" msgstr "`" -#: lib/quotearg.c:260 +#: lib/quotearg.c:269 msgid "'" msgstr "'" diff --git a/po/ja.gmo b/po/ja.gmo index 9c382628..9d766919 100644 Binary files a/po/ja.gmo and b/po/ja.gmo differ diff --git a/po/ja.po b/po/ja.po index 6d44de88..c11c77d6 100644 --- a/po/ja.po +++ b/po/ja.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: GNU bison 1.28\n" -"POT-Creation-Date: 2001-09-27 10:55+0200\n" +"POT-Creation-Date: 2001-09-27 16:21+0200\n" "PO-Revision-Date: 1999-09-28 21:10+0900\n" "Last-Translator: Daisuke Yamashita \n" "Language-Team: Japanese \n" @@ -796,11 +796,11 @@ msgstr "%s: #. MARK). A British English Unicode locale should instead #. translate these to U+2018 (LEFT SINGLE QUOTATION MARK) and #. U+2019 (RIGHT SINGLE QUOTATION MARK), respectively. -#: lib/quotearg.c:259 +#: lib/quotearg.c:268 msgid "`" msgstr "" -#: lib/quotearg.c:260 +#: lib/quotearg.c:269 msgid "'" msgstr "" diff --git a/po/nl.gmo b/po/nl.gmo index 5ae5cecc..6487849b 100644 Binary files a/po/nl.gmo and b/po/nl.gmo differ diff --git a/po/nl.po b/po/nl.po index 93c16288..b8a6b6ba 100644 --- a/po/nl.po +++ b/po/nl.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: bison 1.25\n" -"POT-Creation-Date: 2001-09-27 10:55+0200\n" +"POT-Creation-Date: 2001-09-27 16:21+0200\n" "PO-Revision-Date: 1996-08-27 15:34 MET DST\n" "Last-Translator: Erick Branderhorst \n" "Language-Team: Dutch \n" @@ -799,11 +799,11 @@ msgstr "%s: geen geheugen meer beschikbaar\n" #. MARK). A British English Unicode locale should instead #. translate these to U+2018 (LEFT SINGLE QUOTATION MARK) and #. U+2019 (RIGHT SINGLE QUOTATION MARK), respectively. -#: lib/quotearg.c:259 +#: lib/quotearg.c:268 msgid "`" msgstr "" -#: lib/quotearg.c:260 +#: lib/quotearg.c:269 msgid "'" msgstr "" diff --git a/po/ru.gmo b/po/ru.gmo index 7d6bee60..3e5cb023 100644 Binary files a/po/ru.gmo and b/po/ru.gmo differ diff --git a/po/ru.po b/po/ru.po index ea3116d3..e763ceba 100644 --- a/po/ru.po +++ b/po/ru.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: bison 1.29\n" -"POT-Creation-Date: 2001-09-27 10:55+0200\n" +"POT-Creation-Date: 2001-09-27 16:21+0200\n" "PO-Revision-Date: 2001-09-09 13:49+04:00\n" "Last-Translator: Dmitry S. Sivachenko \n" "Language-Team: Russian \n" @@ -787,11 +787,11 @@ msgstr " #. MARK). A British English Unicode locale should instead #. translate these to U+2018 (LEFT SINGLE QUOTATION MARK) and #. U+2019 (RIGHT SINGLE QUOTATION MARK), respectively. -#: lib/quotearg.c:259 +#: lib/quotearg.c:268 msgid "`" msgstr "`" -#: lib/quotearg.c:260 +#: lib/quotearg.c:269 msgid "'" msgstr "'" diff --git a/po/tr.po b/po/tr.po index fc9d0f77..56505f84 100644 --- a/po/tr.po +++ b/po/tr.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: bison 1.28c\n" -"POT-Creation-Date: 2001-09-27 10:55+0200\n" +"POT-Creation-Date: 2001-09-27 16:21+0200\n" "PO-Revision-Date: 2001-09-10 10:54GMT\n" "Last-Translator: Altug Bayram \n" "Language-Team: Turkish \n" @@ -789,11 +789,11 @@ msgstr "bellek t #. MARK). A British English Unicode locale should instead #. translate these to U+2018 (LEFT SINGLE QUOTATION MARK) and #. U+2019 (RIGHT SINGLE QUOTATION MARK), respectively. -#: lib/quotearg.c:259 +#: lib/quotearg.c:268 msgid "`" msgstr "`" -#: lib/quotearg.c:260 +#: lib/quotearg.c:269 msgid "'" msgstr "'"