Boost logo

Boost :

Subject: Re: [boost] [contract] ready to release
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2018-01-10 20:03:02


On 01/10/2018 12:45 PM, Lorenzo Caminiti via Boost wrote:
> I turns out the Boost inspect program reports the following:
> boost/contract/check.hpp:
> (line 102) Apple macro clash: check
> boost/contract/detail/type_traits/mirror.hpp:
> (line 29) Apple macro clash: check
> Are these a real issues? Boost.Contract uses 'check' as:
> boost::contract::check c = boost::contract::function().precondition(...);
> I could of course renamed that to 'check_' but it looks ugly...

  check is a function-like macro, so it won't affect
that particular usage. Expansion in the class
definition can be blocked with BOOST_PREVENT_MACRO_SUBSTITUTION

> Will a class named check in boost::contract namespace really clash
> with Apple defined names?

  Namespaces don't affect macros, which is why
we ended up adding this to inspect in the first place.

> Or this only an issue for ancient Apple
> compilers and I no longer have to worry about it?

  Also, I noticed one issue with your build/Jamfile.
You should just link to /boost//system regardless of
whether whether you're building a static or shared
library. Putting /boost//system in the usage requirements
does not guarantee that the libraries will be passed
to the linker in the correct order. (In this case
it works because "contract" is lexicographically before
"system", but you really shouldn't rely on that behavior.)

In Christ,
Steven Watanabe

Boost list run by bdawes at, gregod at, cpdaniel at, john at