From 20490c0dedbab8ccd709491c65eb585e0831b5bc Mon Sep 17 00:00:00 2001 From: Thomas Roessler Date: Mon, 12 Jun 2000 07:02:42 +0000 Subject: [PATCH] A new check for working wchar functions. --- configure.in | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/configure.in b/configure.in index 4e2fff630..57d951da5 100644 --- a/configure.in +++ b/configure.in @@ -761,33 +761,16 @@ AC_ARG_WITH(wc-funcs, [ --without-wc-funcs Do not use the system's wcha wc_funcs=$withval) if test "$wc_funcs" != yes -a "$wc_funcs" != no; then - AC_CACHE_CHECK([for working wchar_t functions], mutt_cv_wc_funcs, - AC_TRY_RUN([ + AC_CACHE_CHECK([for wchar_t functions], mutt_cv_wc_funcs, + mutt_cv_wc_funcs=no + AC_TRY_LINK([ +#define _XOPEN_SOURCE 1 #include #include #ifdef HAVE_WCHAR_H #include -#endif -#include -int main() -{ - wchar_t wc = 123; - mbstate_t state; - const char *s = "\304\211"; - int tb; - char *t = (char *)&tb; - setlocale(LC_ALL, "eo.UTF-8"); - memset(&state, 0, sizeof(mbstate_t)); - *(t+2) = 'x'; - exit(!(mbrtowc(0, 0, 0, &state) == 0 && - mbrtowc(&wc, s, 1, &state) == -2 && wc == 123 && - mbrtowc(&wc, s+1, 2, &state) == 1 && - wctomb(t, wc) == 2 && !memcmp(s, t, 2) && *(t+2) == 'x' && - wcwidth(0) == 0 && wcwidth(wc) == 1 && wcwidth(127) == -1)); -} - ], - mutt_cv_wc_funcs=yes, - mutt_cv_wc_funcs=no, +#endif], + [mbrtowc(0, 0, 0, 0); wctomb(0, 0); wcwidth(0);], mutt_cv_wc_funcs=yes)) wc_funcs=$mutt_cv_wc_funcs fi -- 2.40.0