Commit 39f6c4c8 by Krister Walfridsson Committed by Krister Walfridsson

configure.in: Check whether mbstowcs works.

2003-04-24  Krister Walfridsson  <cato@df.lth.se>

        * configure.in: Check whether mbstowcs works.
        * configure, config.in: Regenerate.
        * intl.c: Use HAVE_WORKING_MBSTOWCS.

From-SVN: r66045
parent bcea76b6
2003-04-24 Krister Walfridsson <cato@df.lth.se>
* configure.in: Check whether mbstowcs works.
* configure, config.in: Regenerate.
* intl.c: Use HAVE_WORKING_MBSTOWCS.
2003-04-24 H.J. Lu <hjl@gnu.org> 2003-04-24 H.J. Lu <hjl@gnu.org>
* config/ia64/ia64.c (ia64_init_builtins): Add si_ftype_pdi_di_di * config/ia64/ia64.c (ia64_init_builtins): Add si_ftype_pdi_di_di
......
...@@ -397,6 +397,10 @@ ...@@ -397,6 +397,10 @@
/* Define if you have a working <inttypes.h> header file. */ /* Define if you have a working <inttypes.h> header file. */
#undef HAVE_INTTYPES_H #undef HAVE_INTTYPES_H
/* Define this macro if mbstowcs does not crash when its
first argument is NULL. */
#undef HAVE_WORKING_MBSTOWCS
/* Define if printf supports %p. */ /* Define if printf supports %p. */
#undef HAVE_PRINTF_PTR #undef HAVE_PRINTF_PTR
......
...@@ -789,6 +789,24 @@ AC_CHECK_FUNCS(times clock dup2 kill getrlimit setrlimit atoll atoq \ ...@@ -789,6 +789,24 @@ AC_CHECK_FUNCS(times clock dup2 kill getrlimit setrlimit atoll atoq \
fwrite_unlocked fprintf_unlocked getrusage nl_langinfo lstat \ fwrite_unlocked fprintf_unlocked getrusage nl_langinfo lstat \
scandir alphasort gettimeofday mbstowcs wcswidth) scandir alphasort gettimeofday mbstowcs wcswidth)
if test x$ac_cv_func_mbstowcs = xyes; then
AC_CACHE_CHECK(whether mbstowcs works, gcc_cv_func_mbstowcs_works,
[ AC_TRY_RUN([#include <stdlib.h>
int main()
{
mbstowcs(0, "", 0);
return 0;
}],
gcc_cv_func_mbstowcs_works=yes,
gcc_cv_func_mbstowcs_works=no,
gcc_cv_func_mbstowcs_works=yes)])
if test x$gcc_cv_func_mbstowcs_works = xyes; then
AC_DEFINE(HAVE_WORKING_MBSTOWCS, 1,
[Define this macro if mbstowcs does not crash when its
first argument is NULL.])
fi
fi
AC_CHECK_TYPE(ssize_t, int) AC_CHECK_TYPE(ssize_t, int)
# Try to determine the array type of the second argument of getgroups # Try to determine the array type of the second argument of getgroups
......
...@@ -45,7 +45,7 @@ gcc_init_libintl () ...@@ -45,7 +45,7 @@ gcc_init_libintl ()
(void) textdomain ("gcc"); (void) textdomain ("gcc");
} }
#if defined HAVE_WCHAR_H && defined HAVE_MBSTOWCS && defined HAVE_WCSWIDTH #if defined HAVE_WCHAR_H && defined HAVE_WORKING_MBSTOWCS && defined HAVE_WCSWIDTH
#include <wchar.h> #include <wchar.h>
/* Returns the width in columns of MSGSTR, which came from gettext. /* Returns the width in columns of MSGSTR, which came from gettext.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment