
On Tue, 21 Dec 2004 10:49:56 -0000, John Maddock <john@johnmaddock.co.uk> wrote:
Would it be better to test for _GLIBCPP_HAVE_WCHAR_H instead of sun/__sun though?
Or _GLIBCXX_HAVE_WCHAR_H ;-)
Or maybe all three: do you know if this is an issue for sun's compiler as well? I'm assuming that wchar.h is provided by the platform rather than by gcc?
Sun's compiler (at least the version I have) is a whole 'nother set of problems. It fails probably 90% of the tests in the regression suite, largely due to its marginal template support. The test in question (crc) actually causes an ICE with Sun C++ (http://tinyurl.com/52xsu) <wchar.h> is a system header available in /usr/include so it is usable with either compiler. The Sun compiler does provide a <cwchar> header, but gcc does not provide it (nor std::wstring nor any wide stream support) due to the omission of some C99 standard library functions (cf. http://gcc.gnu.org/ml/gcc-help/2003-12/msg00014.html). I would expect that a future release of gcc may fix this issue, since the missing functions are apparently not needed by libstdc++ for its wide support. The platform-specific test for sun/__sun will work for any compiler on this platform, but if there is perhaps some *other* oddball platform out there for which gcc doesn't provide full wide support, then the _GLIBC**_HAVE_WCHAR_H test would catch those as well. -- Caleb Epstein caleb dot epstein at gmail dot com