From ca57003d65abeda008db6201014ac8dda2244ba9 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 28 May 2011 20:58:14 +0200 Subject: [PATCH] wctype-h: Avoid namespace pollution on Solaris 2.6. * lib/wctype.in.h: On Solaris, undefine 'multibyte' and a few other identifiers. * doc/posix-headers/wctype.texi: Mention the problem. Reported by Tom G. Christensen . (cherry picked from commit 05f391a9c40aaf461aacd0a27fc90bfaafdc5ccc) --- ChangeLog | 8 ++++++++ doc/posix-headers/wctype.texi | 4 ++++ lib/wctype.in.h | 13 +++++++++++++ 3 files changed, 25 insertions(+) diff --git a/ChangeLog b/ChangeLog index 1ee66705c..0c1cc0319 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2011-05-29 Bruno Haible + + wctype-h: Avoid namespace pollution on Solaris 2.6. + * lib/wctype.in.h: On Solaris, undefine 'multibyte' and a few other + identifiers. + * doc/posix-headers/wctype.texi: Mention the problem. + Reported by Tom G. Christensen . + 2011-05-28 Jim Meyering parse-datetime.y: accommodate -Wstrict-overflow diff --git a/doc/posix-headers/wctype.texi b/doc/posix-headers/wctype.texi index 13c50145c..38c239cb7 100644 --- a/doc/posix-headers/wctype.texi +++ b/doc/posix-headers/wctype.texi @@ -25,6 +25,10 @@ IRIX 6.5.30. @item The functions @code{isw*} are actually defined as macros that don't work, on IRIX 5.3. +@item +This header file defines some identifiers, such as @code{multibyte}, as macros +on some platforms: +Solaris 2.6. @end itemize Portability problems not fixed by Gnulib: diff --git a/lib/wctype.in.h b/lib/wctype.in.h index feef37dbe..680d6b095 100644 --- a/lib/wctype.in.h +++ b/lib/wctype.in.h @@ -59,6 +59,19 @@ /* The definition of _GL_WARN_ON_USE is copied here. */ +/* Solaris 2.6 includes which includes which + #defines a number of identifiers in the application namespace. Revert + these #defines. */ +#ifdef __sun +# undef multibyte +# undef eucw1 +# undef eucw2 +# undef eucw3 +# undef scrw1 +# undef scrw2 +# undef scrw3 +#endif + /* Define wint_t and WEOF. (Also done in wchar.in.h.) */ #if !@HAVE_WINT_T@ && !defined wint_t # define wint_t int -- 2.11.0