From e62190098b4ffad8be83b54499c61ef645847efd Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 19 Jun 2013 12:17:13 -0700 Subject: BUILDFIX: changed unsupported static_assert to LL_STATIC_ASSERT. renamed llstatic_assert_template to LL_BAD_TEMPLATE_INSTANTIATION --- indra/llcommon/llerrorlegacy.h | 8 ++++---- indra/llcommon/llunit.h | 17 +++++++++-------- 2 files changed, 13 insertions(+), 12 deletions(-) (limited to 'indra') diff --git a/indra/llcommon/llerrorlegacy.h b/indra/llcommon/llerrorlegacy.h index 097a533b1a..50c95339e4 100755 --- a/indra/llcommon/llerrorlegacy.h +++ b/indra/llcommon/llerrorlegacy.h @@ -113,11 +113,11 @@ const int LL_ERR_PRICE_MISMATCH = -23018; #endif #ifdef LL_WINDOWS -#define llstatic_assert(func, msg) static_assert(func, msg) -#define llstatic_assert_template(type, func, msg) static_assert(func, msg) +#define LL_STATIC_ASSERT(func, msg) static_assert(func, msg) +#define LL_BAD_TEMPLATE_INSTANTIATION(type, msg) static_assert(false, msg) #else -#define llstatic_assert(func, msg) BOOST_STATIC_ASSERT(func) -#define llstatic_assert_template(type, func, msg) BOOST_STATIC_ASSERT(sizeof(type) != 0 && func); +#define LL_STATIC_ASSERT(func, msg) BOOST_STATIC_ASSERT(func) +#define LL_BAD_TEMPLATE_INSTANTIATION(type, msg) BOOST_STATIC_ASSERT(sizeof(type) != 0 && false); #endif // handy compile-time assert - enforce those template parameters! diff --git a/indra/llcommon/llunit.h b/indra/llcommon/llunit.h index 5229fe69d7..2402cdbb95 100644 --- a/indra/llcommon/llunit.h +++ b/indra/llcommon/llunit.h @@ -117,7 +117,7 @@ struct LLUnit void operator *= (LLUnit multiplicand) { // spurious use of dependent type to stop gcc from triggering the static assertion before instantiating the template - llstatic_assert_template(OTHER_UNIT, false, "Multiplication of unit types not supported."); + LL_BAD_TEMPLATE_INSTANTIATION(OTHER_UNIT, "Multiplication of unit types not supported."); } void operator /= (storage_t divisor) @@ -129,7 +129,7 @@ struct LLUnit void operator /= (LLUnit divisor) { // spurious use of dependent type to stop gcc from triggering the static assertion before instantiating the template - llstatic_assert_template(OTHER_UNIT, false, "Illegal in-place division of unit types."); + LL_BAD_TEMPLATE_INSTANTIATION(OTHER_UNIT, "Illegal in-place division of unit types."); } template @@ -172,10 +172,11 @@ struct LLUnitImplicit : public LLUnit template LL_FORCE_INLINE void ll_convert_units(LLUnit in, LLUnit& out, ...) { - static_assert(boost::is_same::value - || !boost::is_same::value - || !boost::is_same::value, - "invalid conversion"); + typedef boost::integral_constant::value + || !boost::is_same::value + || !boost::is_same::value> conversion_valid_t; + LL_STATIC_ASSERT(conversion_valid_t::value, "invalid conversion"); if (boost::is_same::value) { @@ -322,7 +323,7 @@ template operator * (LLUnit, LLUnit) { // spurious use of dependent type to stop gcc from triggering the static assertion before instantiating the template - llstatic_assert_template(STORAGE_TYPE1, false, "Multiplication of unit types results in new unit type - not supported."); + LL_BAD_TEMPLATE_INSTANTIATION(STORAGE_TYPE1, "Multiplication of unit types results in new unit type - not supported."); return LLUnit(); } @@ -342,7 +343,7 @@ template operator * (LLUnitImplicit, LLUnitImplicit) { // spurious use of dependent type to stop gcc from triggering the static assertion before instantiating the template - llstatic_assert_template(STORAGE_TYPE1, false, "Multiplication of unit types results in new unit type - not supported."); + LL_BAD_TEMPLATE_INSTANTIATION(STORAGE_TYPE1, "Multiplication of unit types results in new unit type - not supported."); return LLUnitImplicit(); } -- cgit v1.2.3