Boost logo

Boost :

From: Giovanni Bajo (giovannibajo_at_[hidden])
Date: 2003-12-21 11:14:11


Hello John,

this change:

revision 1.2
date: 2001/02/04 12:59:54; author: johnmaddock; state: Exp; lines: +2 -2
tentative fix for MWCW
-#ifndef BOOST_BUGGY_INTEGRAL_CONSTANT_EXPRESSIONS
+#if !defined(BOOST_BUGGY_INTEGRAL_CONSTANT_EXPRESSIONS) &&
!defined(__MWERKS__)

made MWCW switch to the enum-based static assert implementation. The
implementation has a well-known problem, of course: if two different files use
a static assertion in the same line (and both are included in the same
translation unit) the code will break. In Spirit, this causes a regression
because it really happens this way.

I tested commenting the !defined(__MWERKS__) on MWCW8.3 under Windows, I ran
the regression tests, and everything looks ok. This change also fixes the bug
in Sprit.

I don't have any MWCW versions so I can't check exactly which version fixed the
bug, but your change is rather old. Maybe any 8.x version is ok. To be
conservative, I propose this patch only for versions >= 8.3. Do you think it's
ok?

Thanks
Giovanni Bajo

Index: static_assert.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/static_assert.hpp,v
retrieving revision 1.14
diff -u -w -r1.14 static_assert.hpp
--- static_assert.hpp 4 Oct 2003 11:28:55 -0000 1.14
+++ static_assert.hpp 21 Dec 2003 16:11:36 -0000
@@ -15,6 +15,7 @@
 #define BOOST_STATIC_ASSERT_HPP

 #include <boost/config.hpp>
+#include <boost/detail/workaround.hpp>

 #ifdef __BORLANDC__
 //
@@ -56,7 +57,8 @@
 // style casts: too many compilers currently have problems with static_cast
 // when used inside integral constant expressions.
 //
-#if !defined(BOOST_BUGGY_INTEGRAL_CONSTANT_EXPRESSIONS) &&
!defined(__MWERKS__)
+#if !defined(BOOST_BUGGY_INTEGRAL_CONSTANT_EXPRESSIONS) && \
+ !BOOST_WORKAROUND(__MWERKS__, < 0x3003)

 #if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
 // __LINE__ macro broken when -ZI is used see Q199057


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