Tom G. Christensen reported on the bug-m4 list: | This snapshot fails to build on IRIX 5.3: | source='btowc.c' object='btowc.o' libtool=no \ | DEPDIR=.deps depmode=sgi /bin/ksh ../build-aux/depcomp \ | cc -I. -I/usr/tgcware/include -g -c -o btowc.o btowc.c | cfe: Error: btowc.c, line 37: 'WEOF' undefined; reoccurrences will not be reported. | return WEOF; | ---------^ | make[4]: *** [btowc.o] Error 1 | | I think this is caused by the replacement wchar.h not defining WEOF when | a native wchar.h is not available.
Indeed, this patch lets the compile finish under gcc, so I'm committing it. In fact, it passed the m4/gnulib testsuite without failures (with 9 skips, due to m4 being single-threaded and the Irix box I was testing on not having alternate locales). I'm still planning to retest using cc instead of gcc. From: Eric Blake <e...@byu.net> Date: Mon, 29 Dec 2008 09:09:58 -0700 Subject: [PATCH] wchar.h: supply WEOF on Irix 5.3 * lib/wchar.in.h (wint_t): Also supply WEOF. * lib/wctype.in.h (wint_t): Likewise. * doc/posix-headers/wchar.texi (wchar.h): Document the bug. * doc/posix-headers/wctype.texi (wctype.h): Likewise. Reported by Tom G. Christensen. Signed-off-by: Eric Blake <e...@byu.net> --- ChangeLog | 15 ++++++++++++--- doc/posix-headers/wchar.texi | 2 +- doc/posix-headers/wctype.texi | 2 +- lib/wchar.in.h | 3 +++ lib/wctype.in.h | 3 +++ 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4936022..8bd92e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-12-29 Eric Blake <e...@byu.net> + + wchar.h: supply WEOF on Irix 5.3 + * lib/wchar.in.h (wint_t): Also supply WEOF. + * lib/wctype.in.h (wint_t): Likewise. + * doc/posix-headers/wchar.texi (wchar.h): Document the bug. + * doc/posix-headers/wctype.texi (wctype.h): Likewise. + Reported by Tom G. Christensen. + 2008-12-26 Bruno Haible <br...@clisp.org> * m4/multiarch.m4 (gl_MULTIARCH): Recognize also the architecture names diff --git a/doc/posix-headers/wchar.texi b/doc/posix-headers/wchar.texi index 5e121e8..bdd8232 100644 --- a/doc/posix-headers/wchar.texi +++ b/doc/posix-headers/wchar.texi @@ -14,7 +14,7 @@ Linux uClibc built without wide character support. This header file is not self-contained on some platforms: OSF/1 with Desktop Toolkit C, BSD/OS 4.0.1. @item -The type @code{wint_t} is missing on some platforms: +The type @code{wint_t} and macro @code{WEOF} are missing on some platforms: IRIX 5.3. @end itemize diff --git a/doc/posix-headers/wctype.texi b/doc/posix-headers/wctype.texi index ff56cba..d3438e4 100644 --- a/doc/posix-headers/wctype.texi +++ b/doc/posix-headers/wctype.texi @@ -14,7 +14,7 @@ HP-UX 11.00, BeOS. This header file is not self-contained on some platforms: Solaris 2.5, OSF/1 with Desktop Toolkit C, BSD/OS 4.0.1. @item -The type @code{wint_t} is missing on some platforms: +The type @code{wint_t} and macro @code{WEOF} are missing on some platforms: IRIX 5.3. @item The functions @code{isw*} are missing on some platforms: diff --git a/lib/wchar.in.h b/lib/wchar.in.h index 1250d3b..74e5f24 100644 --- a/lib/wchar.in.h +++ b/lib/wchar.in.h @@ -68,6 +68,9 @@ extern "C" { /* Define wint_t. (Also done in wctype.in.h.) */ #if !...@have_wint_t@ && !defined wint_t # define wint_t int +# ifndef WEOF +# define WEOF -1 +# endif #endif diff --git a/lib/wctype.in.h b/lib/wctype.in.h index 8b33d71..bcd0151 100644 --- a/lib/wctype.in.h +++ b/lib/wctype.in.h @@ -57,6 +57,9 @@ /* Define wint_t. (Also done in wchar.in.h.) */ #if !...@have_wint_t@ && !defined wint_t # define wint_t int +# ifndef WEOF +# define WEOF -1 +# endif #endif /* FreeBSD 4.4 to 4.11 has <wctype.h> but lacks the functions. -- 1.6.0.4