diff options
author | Andrew Meadows <andrew@lindenlab.com> | 2013-01-04 03:02:54 +0000 |
---|---|---|
committer | Andrew Meadows <andrew@lindenlab.com> | 2013-01-04 03:02:54 +0000 |
commit | 019836a39667889d4347277cde82270113992bb6 (patch) | |
tree | 50345c6fb016dc2d0910ac7a39a5317da511ef59 /indra/llcommon | |
parent | 6e82bb7789c1e046dcfb97c6773150df110153f8 (diff) |
More fixes for linux build of lltrace changes
Diffstat (limited to 'indra/llcommon')
-rw-r--r-- | indra/llcommon/llerrorlegacy.h | 2 | ||||
-rw-r--r-- | indra/llcommon/llunit.h | 11 |
2 files changed, 8 insertions, 5 deletions
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<VALUE_TYPE>::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<OTHER_UNIT, OTHER_STORAGE> 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<OTHER_UNIT, OTHER_STORAGE> 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<typename SOURCE_UNITS, typename SOURCE_STORAGE> @@ -313,7 +314,7 @@ template<typename UNIT_TYPE1, typename STORAGE_TYPE1, typename UNIT_TYPE2, typen LLUnit<UNIT_TYPE1, STORAGE_TYPE1> operator * (LLUnit<UNIT_TYPE1, STORAGE_TYPE1>, LLUnit<UNIT_TYPE2, STORAGE_TYPE2>) { // 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<UNIT_TYPE1, STORAGE_TYPE1>(); } @@ -333,7 +334,7 @@ template<typename UNIT_TYPE1, typename STORAGE_TYPE1, typename UNIT_TYPE2, typen LLUnitImplicit<UNIT_TYPE1, STORAGE_TYPE1> operator * (LLUnitImplicit<UNIT_TYPE1, STORAGE_TYPE1>, LLUnitImplicit<UNIT_TYPE2, STORAGE_TYPE2>) { // 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<UNIT_TYPE1, STORAGE_TYPE1>(); } |