X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=m4%2Fmbrtowc.m4;h=bcd52061b0896132f5911a1c2be4ed1f9c40724b;hb=438d74b6b96ac7ccce6791556fe5e27f0e8f7ed8;hp=606de5c9f1a08922024245a1538579ab23aaea3a;hpb=b780e8dc0ca111f94e2c0fa0bc926fce87507b4b;p=pspp diff --git a/m4/mbrtowc.m4 b/m4/mbrtowc.m4 index 606de5c9f1..bcd52061b0 100644 --- a/m4/mbrtowc.m4 +++ b/m4/mbrtowc.m4 @@ -1,4 +1,4 @@ -# mbrtowc.m4 serial 17 +# mbrtowc.m4 serial 20 dnl Copyright (C) 2001-2002, 2004-2005, 2008-2010 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation @@ -101,16 +101,24 @@ AC_DEFUN([gl_MBRTOWC_INCOMPLETE_STATE], dnl is present. changequote(,)dnl case "$host_os" in - # Guess no on AIX and OSF/1. - osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; - # Guess yes otherwise. - *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + # Guess no on AIX and OSF/1. + aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; esac changequote([,])dnl if test $LOCALE_JA != none; then - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include #include +/* 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 int main () { @@ -126,7 +134,7 @@ int main () return 1; } return 0; -}], +}]])], [gl_cv_func_mbrtowc_incomplete_state=yes], [gl_cv_func_mbrtowc_incomplete_state=no], [:]) @@ -156,10 +164,18 @@ changequote(,)dnl esac changequote([,])dnl if test $LOCALE_ZH_CN != none; then - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include #include #include +/* 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 int main () { @@ -178,7 +194,7 @@ int main () return 1; } return 0; -}], +}]])], [gl_cv_func_mbrtowc_sanitycheck=yes], [gl_cv_func_mbrtowc_sanitycheck=no], [:]) @@ -208,9 +224,17 @@ changequote(,)dnl esac changequote([,])dnl if test $LOCALE_FR_UTF8 != none; then - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include #include +/* 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 int main () { @@ -228,7 +252,10 @@ int main () return 1; } return 0; -}], [gl_cv_func_mbrtowc_null_arg=yes], [gl_cv_func_mbrtowc_null_arg=no], [:]) +}]])], + [gl_cv_func_mbrtowc_null_arg=yes], + [gl_cv_func_mbrtowc_null_arg=no], + [:]) fi ]) ]) @@ -258,12 +285,21 @@ changequote(,)dnl esac changequote([,])dnl if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none; then - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include #include +/* 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 int main () { + int result = 0; /* This fails on Solaris. */ if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) { @@ -276,7 +312,7 @@ int main () { input[1] = '\0'; if (mbrtowc (&wc, input + 2, 5, &state) != 1) - return 1; + result |= 1; } } /* This fails on HP-UX 11.11. */ @@ -291,11 +327,11 @@ int main () { input[1] = '\0'; if (mbrtowc (&wc, input + 2, 5, &state) != 2) - return 1; + result |= 2; } } - return 0; -}], + return result; +}]])], [gl_cv_func_mbrtowc_retval=yes], [gl_cv_func_mbrtowc_retval=no], [:]) @@ -325,9 +361,17 @@ changequote(,)dnl esac changequote([,])dnl if test $LOCALE_ZH_CN != none; then - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include #include +/* 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 int main () { @@ -342,7 +386,7 @@ int main () return 1; } return 0; -}], +}]])], [gl_cv_func_mbrtowc_nul_retval=yes], [gl_cv_func_mbrtowc_nul_retval=no], [:]) @@ -358,10 +402,8 @@ AC_DEFUN([gl_PREREQ_MBRTOWC], [ dnl From Paul Eggert -dnl This override of an autoconf macro can be removed when autoconf 2.60 or -dnl newer can be assumed everywhere. +dnl This is an override of an autoconf macro. -m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.60]),[-1],[ AC_DEFUN([AC_FUNC_MBRTOWC], [ dnl Same as AC_FUNC_MBRTOWC in autoconf-2.60. @@ -369,7 +411,14 @@ AC_DEFUN([AC_FUNC_MBRTOWC], gl_cv_func_mbrtowc, [AC_LINK_IFELSE( [AC_LANG_PROGRAM( - [[#include ]], + [[/* 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 ]], [[wchar_t wc; char const s[] = ""; size_t n = 1; @@ -382,4 +431,3 @@ AC_DEFUN([AC_FUNC_MBRTOWC], [Define to 1 if mbrtowc and mbstate_t are properly declared.]) fi ]) -])