Boost logo

Boost :

Subject: Re: [boost] [config][hp-ux] UTF-8 codecvt_facet.cpp failing on HP-UX
From: John Maddock (boost.regex_at_[hidden])
Date: 2011-06-08 12:10:16


> There is a Filesystem bug report, 5048, that actually affects any
> library using ...\libs\detail\utf8_codecvt_facet.cpp
>
> The problem is line 255: #elif WCHAR_MAX > 0x10000
>
> On HP-UX, WCHAR_MAX is defined like this:
>
> # if defined(_INCLUDE_STDCSOURCE_199901)
> # define WCHAR_MAX UINT_MAX /* max value of an unsigned integer */
> # define WCHAR_MIN 0
> # else
> # define WCHAR_MAX (wchar_t)UINT_MAX /* max value of an unsigned integer
> */
> # define WCHAR_MIN (wchar_t)0
> # endif
>
> An obvious fix is to add #define _INCLUDE_STDCSOURCE_199901 to
> ...\boost\config\platform\hpux.hpp, and that's been confirmed by the
> user who originated the bug report.
>
> I'm guessing that this fix doesn't work if the user includes
> <stdint.h> before <boost/config.hpp>, but can't think of anything
> better.
>
> Any objections to committing the change to
> ...\boost\config\platform\hpux.hpp?

No.... but why not just define that symbol at the top of the .cpp file in
question (before any #includes) and thereby guarantee to fix the issue?

John.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk