Boost logo

Boost :

From: Angus Leeming (angus.leeming_at_[hidden])
Date: 2005-10-14 04:13:12


Joaquín Mª López Muñoz wrote:
> But I think it makes much more sense if BOOST_WORKAROUND itself includes
> the patch, so that instead of its current definition
>
> # define BOOST_WORKAROUND(symbol, test) \
> ((symbol != 0) && (1 % (( (symbol test) ) + 1)))
>
> it looks like
>
> # define BOOST_WORKAROUND(symbol, test) \
> (defined(symbol) && (symbol != 0) && (1 % (( (symbol test) ) +
> 1)))
>
> Anyone sees some problem with this?

That would be much nicer. However, reverting my patch and applying yours
(below, to confirm I got it right :)), I get this when compiling my test
case:

$ g++ -Wundef -Iboost/cvs -o trial trial.cpp
In file included from boost/cvs/boost/random.hpp:36,
                 from trial.cpp:1:
boost/cvs/boost/random/linear_congruential.hpp:139:64: operator "defined"
requires an identifier
boost/cvs/boost/random/linear_congruential.hpp:139:64: missing '(' in
expression

Index: boost/detail/workaround.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/detail/workaround.hpp,v
retrieving revision 1.11
diff -u -p -r1.11 workaround.hpp
--- boost/detail/workaround.hpp 25 Aug 2005 16:27:20 -0000 1.11
+++ boost/detail/workaround.hpp 14 Oct 2005 09:07:35 -0000
@@ -39,7 +39,7 @@
 # ifndef BOOST_STRICT_CONFIG

 # define BOOST_WORKAROUND(symbol, test) \
- ((symbol != 0) && (1 % (( (symbol test) ) + 1)))
+ (defined(symbol) && (symbol != 0) && (1 % (( (symbol test) ) +
1)))
 // ^ ^ ^ ^
 // The extra level of parenthesis nesting above, along with the
 // BOOST_OPEN_PAREN indirection below, is required to satisfy the
[angus_at_boris cvs]$


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