Boost logo

Boost Users :

From: Howard Hinnant (hinnant_at_[hidden])
Date: 2005-01-01 19:21:43


On Jan 1, 2005, at 4:26 PM, Steve Folly wrote:

> Hi,
>
> I'm having a problem trying to compile the regex library for
> Codewarrior 9.3 on the Mac, for an x86 target.
>
> There wasn't a Codewarrior project so I created my own and included
> the source code under libs/regex/src, I'm creating a static library.
>
> 1.31.0 and 1.32.0 have the same problem:
>
> The problem is that for a Codewarrior x86 target (running on a Mac),
> boost configures it's BOOST_USE_FACET macro to be the standard
> conforming std::use_facet. Codewarrior's use_facet takes two
> parameters in this case.
>
> I added the two following #defines to the C++ Preprocessor preference
> panel:
>
> #define BOOST_NO_STD_USE_FACET
> #define BOOST_HAS_TWO_ARG_USE_FACET
>
> and it compiled.
>
> Is this the right fix?

I can help more as a CodeWarrior expert than a boost expert. The 9.3
CodeWarrior isn't configured out of the box for std::use_facet to take
two parameters, though it can be set up that way. Specifically,
CodeWarrior 9.3 has:

#ifndef _MSL_NO_EXPLICIT_FUNC_TEMPLATE_ARG

template <class Facet>
const Facet&
use_facet(const locale& loc)
{
     ...
}

#else // _MSL_NO_EXPLICIT_FUNC_TEMPLATE_ARG

template <class Facet>
inline
const Facet&
use_facet(const locale& loc, Facet* p)
{
     ...
}

#endif // _MSL_NO_EXPLICIT_FUNC_TEMPLATE_ARG

I.e. If _MSL_NO_EXPLICIT_FUNC_TEMPLATE_ARG is not defined, you get the
standard use_facet signature. And _MSL_NO_EXPLICIT_FUNC_TEMPLATE_ARG
is not defined by default. Indeed this flag is something of a relic
and hasn't been used (by Metrowerks) for several years. Is there a
reason that you have defined it? And if so, could you simply not
define it, and solve your problem that way?

Oh! <slapping forehead> I just reviewed our sources with respect to
this flag. If you choose "ms-compatible mangling", and I think that
means VC++ 6.0 compatible, then _MSL_NO_EXPLICIT_FUNC_TEMPLATE_ARG gets
turned on automatically. The early MS mangling scheme simply does not
support explicit template arguments for functions. Do you really need
this feature? If so, continue pursuing the boost-end fix. Otherwise,
I recommend turning it off and going standard.

-Howard


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net