Boost logo

Boost :

From: Boris Gubenko (Boris.Gubenko_at_[hidden])
Date: 2006-08-23 12:20:48


Perhaps, I don't understand what BOOST_NO_SWPRINTF macro is for. From
what I can see in the configuration headers for other platforms, this
macro is set if a platforms does not have native swprintf.

On HP-UX, if the compiler predefines _INCLUDE__STDC_A1_SOURCE macro,
it means, that the platform has native swprintf and in this case,
BOOST_NO_SWPRINTF macro should not be defined. It was the intention of
the original condition and a quick experiment shows, that it works as
intended.

Before the fix, hpux.hpp would define BOOST_NO_SWPRINTF macro
unconditionally. After the fix, it does not define it if a platform
has native swprintf. I'm sure I'm missing something, I just don't know
what it is :-)

x.cpp
-----
#if !(defined(__HP_aCC) && defined(_INCLUDE__STDC_A1_SOURCE))
# define BOOST_NO_SWPRINTF
#endif

#ifdef BOOST_NO_SWPRINTF
# error BOOST_NO_SWPRINTF is defined
#else
# error BOOST_NO_SWPRINTF is not defined
#endif

bash-3.00$ uname -a
HP-UX granite B.11.23 U ia64 2207888362 unlimited-user license
bash-3.00$ aCC -E x.cpp 2>&1 | grep \#error
"x.cpp", line 8: error #2035: #error directive: BOOST_NO_SWPRINTF is not
defined
bash-3.00$

bash-2.03$ uname -a
HP-UX cal-bear B.11.11 U 9000/800 149901597 unlimited-user license
bash-2.03$ aCC -E x.cpp 2>&1 | grep \#error
Error 119: "x.cpp", line 6 # #error BOOST_NO_SWPRINTF is defined
bash-2.03$

> Still confused yours,
> John.

Utterly confused,
  Boris

----- Original Message -----
From: "John Maddock" <john_at_[hidden]>
To: <boost_at_[hidden]>
Cc: "Boris Gubenko" <Boris.Gubenko_at_[hidden]>
Sent: Wednesday, August 23, 2006 4:51 AM
Subject: Re: [boost] [regex] patch for config/platform/hpux.hpp

> Boris Gubenko wrote:
>> John Maddock wrote:
>>>
>>> Will do, but shouldn't
>>>
>>
>> Thank you!
>>
>>>> < #if !(defined(__HP_aCC) && defined(_INCLUDE__STDC_A1_SOURCE))
>>>> < # define BOOST_NO_SWPRINTF
>>>> < # define BOOST_NO_CWCTYPE
>>>> < #endif
>>>
>>> Be #if !(defined(__HP_aCC) && !defined(_INCLUDE__STDC_A1_SOURCE)) ?
>>>
>>
>> No, I don't think so. The original condition says: don't define
>> BOOST_NO_SWPRINTF and BOOST_NO_CWCTYPE macros when compiling with aCC
>> with _INCLUDE__STDC_A1_SOURCE macro defined. This macro exposes I18N
>> features added in 11i. On appropriate platforms, aCC predefines
>> this macro.
>
> Right, so if _INCLUDE__STDC_A1_SOURCE *is* defined, you *don't* want that
> pp-branch taken, so I still think it should be &&
> !defined(_INCLUDE__STDC_A1_SOURCE) :-)
>
> Still confused yours,
>
> John.
>
>


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