X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=m4%2Fwctype_h.m4;h=95a4705b0e74cdbd9bcfd5633c499a529a40cf71;hb=d30babc23b4f25be970ada2e63a50220a3672281;hp=ef9fb049ce69013c8e4dbf5f3f303bead075d0fa;hpb=1a44d77d50f4fb37c0410eed04b82303624ea2ec;p=debian%2Ftar diff --git a/m4/wctype_h.m4 b/m4/wctype_h.m4 index ef9fb049..95a4705b 100644 --- a/m4/wctype_h.m4 +++ b/m4/wctype_h.m4 @@ -1,8 +1,8 @@ -# wctype_h.m4 serial 14 +# wctype_h.m4 serial 18 dnl A placeholder for ISO C99 , for platforms that lack it. -dnl Copyright (C) 2006-2011 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2015 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -22,8 +22,6 @@ AC_DEFUN([gl_WCTYPE_H], fi AC_SUBST([HAVE_ISWCNTRL]) - AC_REQUIRE([AC_C_INLINE]) - AC_REQUIRE([gt_TYPE_WINT_T]) if test $gt_cv_c_wint_t = yes; then HAVE_WINT_T=1 @@ -57,7 +55,8 @@ AC_DEFUN([gl_WCTYPE_H], #if __GNU_LIBRARY__ == 1 Linux libc5 i18n is broken. #endif]], [])], - [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no]) + [gl_cv_func_iswcntrl_works="guessing yes"], + [gl_cv_func_iswcntrl_works="guessing no"]) ]) ]) fi @@ -67,15 +66,51 @@ AC_DEFUN([gl_WCTYPE_H], fi AC_SUBST([HAVE_WCTYPE_H]) - if test "$gl_cv_func_iswcntrl_works" = no; then - REPLACE_ISWCNTRL=1 - else - REPLACE_ISWCNTRL=0 - fi + case "$gl_cv_func_iswcntrl_works" in + *yes) REPLACE_ISWCNTRL=0 ;; + *) REPLACE_ISWCNTRL=1 ;; + esac AC_SUBST([REPLACE_ISWCNTRL]) if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then - dnl Redefine all of iswcntrl, ..., towupper in . + dnl Redefine all of iswcntrl, ..., iswxdigit in . + : + fi + + if test $REPLACE_ISWCNTRL = 1; then + REPLACE_TOWLOWER=1 + else + AC_CHECK_FUNCS([towlower]) + if test $ac_cv_func_towlower = yes; then + REPLACE_TOWLOWER=0 + else + AC_CHECK_DECLS([towlower],,, + [[/* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #if HAVE_WCTYPE_H + # include + #endif + ]]) + if test $ac_cv_have_decl_towlower = yes; then + dnl On Minix 3.1.8, the system's declares towlower() and + dnl towupper() although it does not have the functions. Avoid a + dnl collision with gnulib's replacement. + REPLACE_TOWLOWER=1 + else + REPLACE_TOWLOWER=0 + fi + fi + fi + AC_SUBST([REPLACE_TOWLOWER]) + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then + dnl Redefine towlower, towupper in . : fi