Boost logo

Boost :

Subject: Re: [boost] [config][hp-ux] UTF-8 codecvt_facet.cpp failing on HP-UX
From: Beman Dawes (bdawes_at_[hidden])
Date: 2011-06-09 07:09:41


On Wed, Jun 8, 2011 at 12:10 PM, John Maddock <boost.regex_at_[hidden]> wrote:
>> 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?

Good question! I was looking for a more general solution, but you are
right that a local fix is more appropriate.

--Beman


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