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
This commit is contained in:
Krister Walfridsson 2003-04-24 20:35:45 +02:00 committed by Krister Walfridsson
parent bcea76b65d
commit 39f6c4c89e
5 changed files with 251 additions and 181 deletions

View File

@ -1,3 +1,9 @@
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>
* config/ia64/ia64.c (ia64_init_builtins): Add si_ftype_pdi_di_di

View File

@ -397,6 +397,10 @@
/* Define if you have a working <inttypes.h> header file. */
#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. */
#undef HAVE_PRINTF_PTR

402
gcc/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -789,6 +789,24 @@ AC_CHECK_FUNCS(times clock dup2 kill getrlimit setrlimit atoll atoq \
fwrite_unlocked fprintf_unlocked getrusage nl_langinfo lstat \
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)
# Try to determine the array type of the second argument of getgroups

View File

@ -45,7 +45,7 @@ gcc_init_libintl ()
(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>
/* Returns the width in columns of MSGSTR, which came from gettext.