From 019836a39667889d4347277cde82270113992bb6 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Fri, 4 Jan 2013 03:02:54 +0000 Subject: More fixes for linux build of lltrace changes --- indra/llcommon/llerrorlegacy.h | 2 ++ indra/llcommon/llunit.h | 11 ++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llerrorlegacy.h b/indra/llcommon/llerrorlegacy.h index 58cc2899af..097a533b1a 100644 --- a/indra/llcommon/llerrorlegacy.h +++ b/indra/llcommon/llerrorlegacy.h @@ -114,8 +114,10 @@ const int LL_ERR_PRICE_MISMATCH = -23018; #ifdef LL_WINDOWS #define llstatic_assert(func, msg) static_assert(func, msg) +#define llstatic_assert_template(type, func, msg) static_assert(func, 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); #endif // handy compile-time assert - enforce those template parameters! diff --git a/indra/llcommon/llunit.h b/indra/llcommon/llunit.h index 72a6020ff8..c600883607 100644 --- a/indra/llcommon/llunit.h +++ b/indra/llcommon/llunit.h @@ -29,6 +29,7 @@ #include "stdtypes.h" #include "llpreprocessor.h" +#include "llerrorlegacy.h" namespace LLUnits { @@ -53,7 +54,7 @@ struct ConversionFactor static typename HighestPrecisionType::type_t get() { // spurious use of dependent type to stop gcc from triggering the static assertion before instantiating the template - llstatic_assert(sizeof(DERIVED_UNITS_TAG) == 0, "Cannot convert between types."); + llstatic_assert_template(DERIVED_UNITS_TAG, false, "Cannot convert between types."); } }; @@ -141,7 +142,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(sizeof(OTHER_UNIT) == 0, "Multiplication of unit types not supported."); + llstatic_assert_template(OTHER_UNIT, 0, "Multiplication of unit types not supported."); } void operator /= (storage_t divisor) @@ -153,7 +154,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(sizeof(OTHER_UNIT) == 0, "Illegal in-place division of unit types."); + llstatic_assert_template(OTHER_UNIT, 0, "Illegal in-place division of unit types."); } template @@ -313,7 +314,7 @@ template operator * (LLUnit, LLUnit) { // spurious use of dependent type to stop gcc from triggering the static assertion before instantiating the template - llstatic_assert(sizeof(STORAGE_TYPE1) == 0, "Multiplication of unit types results in new unit type - not supported."); + llstatic_assert_template(STORAGE_TYPE1, 0, "Multiplication of unit types results in new unit type - not supported."); return LLUnit(); } @@ -333,7 +334,7 @@ template operator * (LLUnitImplicit, LLUnitImplicit) { // spurious use of dependent type to stop gcc from triggering the static assertion before instantiating the template - llstatic_assert(sizeof(STORAGE_TYPE1) == 0, "Multiplication of unit types results in new unit type - not supported."); + llstatic_assert_template(STORAGE_TYPE1, 0, "Multiplication of unit types results in new unit type - not supported."); return LLUnitImplicit(); } -- cgit v1.2.3