2005-01-16 Bruno Haible Stepan Kasal * configure.in: Add tests for iswctype, mbrlen, wcrtomb, wcscoll; use AC_FUNC_MBRTOWC to check for mbrtowc and mbstate_t; move AC_MBSTATE_T below it. * src/grep.c: Include mbsupport.h to define MBS_SUPPORT uniformly. * src/mbsupport.h: Don't test for HAVE_WCTYPE_T. Index: configure.in =================================================================== RCS file: /cvsroot/grep/grep/configure.in,v retrieving revision 1.85 diff -u -r1.85 configure.in --- configure.in 20 Nov 2004 15:14:39 -0000 1.85 +++ configure.in 28 Jan 2005 13:25:22 -0000 @@ -64,7 +64,6 @@ AC_CHECK_HEADERS(wctype.h wchar.h) AC_HEADER_DIRENT AC_HEADER_STAT -AC_MBSTATE_T dnl Checks for functions. AC_FUNC_ALLOCA @@ -72,7 +71,11 @@ AC_FUNC_MMAP dnl getpagesize is checked for by AC_FUNC_MMAP. -AC_CHECK_FUNCS(btowc isascii memmove setmode strerror wctype mbrtowc) +AC_CHECK_FUNCS(btowc isascii iswctype mbrlen memmove setmode strerror wcrtomb wcscoll wctype) +# We can use mbrtowc only if we have mbstate_t. +AC_FUNC_MBRTOWC +# Yet we need a mbstate_t stub in every case. +AC_MBSTATE_T AC_REPLACE_FUNCS(memchr stpcpy strtoul atexit fnmatch) jm_AC_PREREQ_XSTRTOUMAX Index: src/grep.c =================================================================== RCS file: /cvsroot/grep/grep/src/grep.c,v retrieving revision 1.91 diff -u -r1.91 grep.c --- src/grep.c 16 Dec 2004 08:19:29 -0000 1.91 +++ src/grep.c 28 Jan 2005 13:25:22 -0000 @@ -30,9 +30,8 @@ # include # include #endif -#if defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H && defined HAVE_MBRTOWC -/* We can handle multibyte string. */ -# define MBS_SUPPORT +#include "mbsupport.h" +#ifdef MBS_SUPPORT # include # include #endif Index: src/mbsupport.h =================================================================== RCS file: /cvsroot/grep/grep/src/mbsupport.h,v retrieving revision 1.1 diff -u -r1.1 mbsupport.h --- src/mbsupport.h 19 Nov 2004 16:38:52 -0000 1.1 +++ src/mbsupport.h 28 Jan 2005 13:25:22 -0000 @@ -3,7 +3,7 @@ */ /* - * Copyright (C) 2004 the Free Software Foundation, Inc. + * Copyright (C) 2004, 2005 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. @@ -45,7 +45,6 @@ && defined(HAVE_WCSCOLL) \ && defined(HAVE_WCTYPE) \ && defined(HAVE_WCTYPE_H) \ - && defined(HAVE_WCTYPE_T) \ && (defined(HAVE_STDLIB_H) && defined(MB_CUR_MAX)) \ /* We can handle multibyte strings. */ # define MBS_SUPPORT 1