Paul Eggert <eggert <at> CS.UCLA.EDU> writes: > > This is following up on the thread here: > <http://lists.gnu.org/archive/html/bug-coreutils/2006-12/msg00017.html> > ... > We could put this into every source file that includes wctype.h, > but I think it's cleaner to have a wctype module that handles > wctype gotchas like this. > > 2006-12-21 Paul Eggert <eggert <at> cs.ucla.edu> > > * MODULES.html.sh: New module wctype. > * lib/wctype_.h, m4/wctype.m4, modules/wctype: New files. > * lib/fnmatch.c: Don't bother to include <wchar.h> before > <wctype.h>, since the new wctype module should fix this.
> Index: lib/fnmatch.c > =================================================================== > RCS file: /cvsroot/gnulib/gnulib/lib/fnmatch.c,v > retrieving revision 1.37 > diff -u -p -r1.37 fnmatch.c > --- lib/fnmatch.c 4 Dec 2006 06:41:56 -0000 1.37 > +++ lib/fnmatch.c 22 Dec 2006 00:21:51 -0000 > <at> <at> -46,8 +46,6 <at> <at> > /* For platform which support the ISO C amendement 1 functionality we > support user defined character classes. */ > #if defined _LIBC || WIDE_CHAR_SUPPORT > -/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */ > -# include <wchar.h> > # include <wctype.h> > #endif This is breaking the coreutils build on cygwin, where btowc and friends are in <wchar.h>, and where <wctype.h> is POSIX-compliant but does not drag in the entire <wchar.h>: gcc -std=gnu99 -I. -I/usr/local/include -g2 -Wall -Werror -MT fnmatch.o - MD -MP -MF .deps/fnmatch.Tpo -c -o fnmatch.o fnmatch.c In file included from fnmatch.c:172: fnmatch_loop.c: In function `internal_fnmatch': fnmatch_loop.c:287: warning: implicit declaration of function `btowc' In file included from fnmatch.c:269: fnmatch_loop.c: In function `internal_fnwmatch': fnmatch_loop.c:141: warning: implicit declaration of function `wmemchr' fnmatch_loop.c:141: warning: comparison between pointer and integer fnmatch_loop.c:152: warning: assignment makes pointer from integer without a cast fnmatch_loop.c: In function `ext_wmatch': fnmatch_loop.c:1009: warning: implicit declaration of function `wcslen' fnmatch_loop.c:1068: warning: implicit declaration of function `wmemcpy' fnmatch_loop.c:1134: warning: implicit declaration of function `wcscat' fnmatch_loop.c:1136: warning: passing arg 1 of `internal_fnwmatch' makes pointer from integer without a cast fnmatch.c: In function `gnu_fnmatch': fnmatch.c:280: error: `mbstate_t' undeclared (first use in this function) fnmatch.c:280: error: (Each undeclared identifier is reported only once fnmatch.c:280: error: for each function it appears in.) fnmatch.c:280: error: parse error before "ps" fnmatch.c:290: error: `ps' undeclared (first use in this function) fnmatch.c:291: warning: implicit declaration of function `mbsrtowcs' fnmatch.c:294: warning: implicit declaration of function `mbsinit' make[2]: *** [fnmatch.o] Error 1 -- Eric Blake