diff --git a/indra/llcommon/llerror.h b/indra/llcommon/llerror.h index dc7274312..7bf467621 100644 --- a/indra/llcommon/llerror.h +++ b/indra/llcommon/llerror.h @@ -72,7 +72,7 @@ const int LL_ERR_NOERR = 0; #endif // !_DEBUG -static const std::string liru_assert_strip(const std::string& file) { return file.substr(1+file.substr(0, file.find_last_of("/\\")).find_last_of("/\\")); } //return foo/bar.cpp or perhaps foo\bar.cpp +inline const std::string liru_assert_strip(const std::string& file) { return file.substr(1+file.substr(0, file.find_last_of("/\\")).find_last_of("/\\")); } //return foo/bar.cpp or perhaps foo\bar.cpp #define llassert_always_msg(func, msg) if (LL_UNLIKELY(!(func))) LL_ERRS() << "ASSERT (" << msg << ")\nfile:" << liru_assert_strip(__FILE__) << " line:" << std::dec << __LINE__ << LL_ENDL diff --git a/indra/llcommon/lluuid.h b/indra/llcommon/lluuid.h index 66a845738..7923d50db 100644 --- a/indra/llcommon/lluuid.h +++ b/indra/llcommon/lluuid.h @@ -271,7 +271,7 @@ inline U32 LLUUID::getCRC32() const // } -static_assert(std::is_trivially_copyable{}, "LLUUID must be a trivially copyable type"); +static_assert(std::is_trivially_copyable::value, "LLUUID must be a trivially copyable type"); typedef std::vector uuid_vec_t; typedef boost::unordered_set uuid_set_t; diff --git a/indra/llcommon/stdtypes.h b/indra/llcommon/stdtypes.h index b5079f849..4b7d95bb1 100644 --- a/indra/llcommon/stdtypes.h +++ b/indra/llcommon/stdtypes.h @@ -109,3 +109,15 @@ typedef U8 LLPCode; #define LL_ARRAY_SIZE( _kArray ) ( sizeof( (_kArray) ) / sizeof( _kArray[0] ) ) #endif + +#if __GNUG__ && __GNUC__ < 5 +namespace std +{ + template + struct is_trivially_copyable + { + static const bool value = __has_trivial_copy(T); + operator bool() { return value; } + }; +} +#endif diff --git a/indra/llmath/llmatrix4a.h b/indra/llmath/llmatrix4a.h index 7334eec52..301fec84d 100644 --- a/indra/llmath/llmatrix4a.h +++ b/indra/llmath/llmatrix4a.h @@ -709,5 +709,5 @@ inline std::ostream& operator<<(std::ostream& s, const LLMatrix4a& m) void matMulBoundBox(const LLMatrix4a &a, const LLVector4a *in_extents, LLVector4a *out_extents); -static_assert(std::is_trivially_copyable{}, "LLMatrix4a must be a trivially copyable type"); +static_assert(std::is_trivially_copyable::value, "LLMatrix4a must be a trivially copyable type"); #endif diff --git a/indra/llmath/llquaternion.h b/indra/llmath/llquaternion.h index 87b272008..5cf7e20c8 100644 --- a/indra/llmath/llquaternion.h +++ b/indra/llmath/llquaternion.h @@ -191,7 +191,7 @@ inline void LLQuaternion::setValue(const LLSD& sd) mQ[3] = sd[3].asReal(); } -static_assert(std::is_trivially_copyable{}, "LLQuaternion must be a trivially copyable type"); +static_assert(std::is_trivially_copyable::value, "LLQuaternion must be a trivially copyable type"); // checker inline BOOL LLQuaternion::isFinite() const diff --git a/indra/llmath/llquaternion2.h b/indra/llmath/llquaternion2.h index b93d0471b..6d616a9b3 100644 --- a/indra/llmath/llquaternion2.h +++ b/indra/llmath/llquaternion2.h @@ -105,6 +105,6 @@ protected: } LL_ALIGN_POSTFIX(16); -static_assert(std::is_trivially_copyable{}, "LLQuaternion2 must be a trivially copyable type"); +static_assert(std::is_trivially_copyable::value, "LLQuaternion2 must be a trivially copyable type"); #endif diff --git a/indra/llmath/llsimdtypes.h b/indra/llmath/llsimdtypes.h index 2861fa9b0..86430b917 100644 --- a/indra/llmath/llsimdtypes.h +++ b/indra/llmath/llsimdtypes.h @@ -121,7 +121,7 @@ private: LLQuad mQ; }; -static_assert(std::is_trivially_copyable{}, "LLBool32 must be a trivially copyable type"); -static_assert(std::is_trivially_copyable{}, "LLSimdScalar must be a trivially copyable type"); +static_assert(std::is_trivially_copyable::value, "LLBool32 must be a trivially copyable type"); +static_assert(std::is_trivially_copyable::value, "LLSimdScalar must be a trivially copyable type"); #endif //LL_SIMD_TYPES_H diff --git a/indra/llmath/llvector4a.h b/indra/llmath/llvector4a.h index 2b7cf10cb..04e2de2e2 100644 --- a/indra/llmath/llvector4a.h +++ b/indra/llmath/llvector4a.h @@ -346,5 +346,5 @@ inline std::ostream& operator<<(std::ostream& s, const LLVector4a& v) return s; } -static_assert(std::is_trivially_copyable{}, "LLVector4a must be a trivially copyable type"); +static_assert(std::is_trivially_copyable::value, "LLVector4a must be a trivially copyable type"); #endif diff --git a/indra/llmath/m3math.h b/indra/llmath/m3math.h index 5822ff044..a25f3e906 100644 --- a/indra/llmath/m3math.h +++ b/indra/llmath/m3math.h @@ -144,7 +144,7 @@ class LLMatrix3 friend std::ostream& operator<<(std::ostream& s, const LLMatrix3 &a); // Stream a }; -static_assert(std::is_trivially_copyable{}, "LLMatrix3 must be a trivially copyable type"); +static_assert(std::is_trivially_copyable::value, "LLMatrix3 must be a trivially copyable type"); inline LLMatrix3::LLMatrix3(void) { diff --git a/indra/llmath/m4math.h b/indra/llmath/m4math.h index 01739218b..c4d37d0f7 100644 --- a/indra/llmath/m4math.h +++ b/indra/llmath/m4math.h @@ -246,7 +246,7 @@ public: friend std::ostream& operator<<(std::ostream& s, const LLMatrix4 &a); // Stream a }; -static_assert(std::is_trivially_copyable{}, "LLMatrix4 must be a trivially copyable type"); +static_assert(std::is_trivially_copyable::value, "LLMatrix4 must be a trivially copyable type"); inline const LLMatrix4& LLMatrix4::setIdentity() { diff --git a/indra/llmath/v2math.h b/indra/llmath/v2math.h index cc00096cc..d6fb00438 100644 --- a/indra/llmath/v2math.h +++ b/indra/llmath/v2math.h @@ -110,7 +110,7 @@ class LLVector2 friend std::ostream& operator<<(std::ostream& s, const LLVector2 &a); // Stream a }; -static_assert(std::is_trivially_copyable{}, "LLVector2 must be a trivially copyable type"); +static_assert(std::is_trivially_copyable::value, "LLVector2 must be a trivially copyable type"); // Non-member functions diff --git a/indra/llmath/v3color.h b/indra/llmath/v3color.h index d9a7f6286..b8a5fb95e 100644 --- a/indra/llmath/v3color.h +++ b/indra/llmath/v3color.h @@ -140,7 +140,7 @@ public: inline void exp(); // Do an exponential on the color }; -static_assert(std::is_trivially_copyable{}, "LLColor3 must be a trivially copyable type"); +static_assert(std::is_trivially_copyable::value, "LLColor3 must be a trivially copyable type"); LLColor3 lerp(const LLColor3 &a, const LLColor3 &b, F32 u); diff --git a/indra/llmath/v3dmath.h b/indra/llmath/v3dmath.h index eed1ed061..2efa5a500 100644 --- a/indra/llmath/v3dmath.h +++ b/indra/llmath/v3dmath.h @@ -130,7 +130,7 @@ class LLVector3d }; -static_assert(std::is_trivially_copyable{}, "LLVector3d must be a trivially copyable type"); +static_assert(std::is_trivially_copyable::value, "LLVector3d must be a trivially copyable type"); typedef LLVector3d LLGlobalVec; diff --git a/indra/llmath/v3math.h b/indra/llmath/v3math.h index 65122b894..35acead65 100644 --- a/indra/llmath/v3math.h +++ b/indra/llmath/v3math.h @@ -149,7 +149,7 @@ class LLVector3 static BOOL parseVector3(const std::string& buf, LLVector3* value); }; -static_assert(std::is_trivially_copyable{}, "LLVector3 must be a trivially copyable type"); +static_assert(std::is_trivially_copyable::value, "LLVector3 must be a trivially copyable type"); typedef LLVector3 LLSimLocalVec; diff --git a/indra/llmath/v4color.h b/indra/llmath/v4color.h index e23d51075..845160d3d 100644 --- a/indra/llmath/v4color.h +++ b/indra/llmath/v4color.h @@ -222,7 +222,7 @@ class LLColor4 inline void clamp(); }; -static_assert(std::is_trivially_copyable{}, "LLColor4 must be a trivially copyable type"); +static_assert(std::is_trivially_copyable::value, "LLColor4 must be a trivially copyable type"); // Non-member functions F32 distVec(const LLColor4 &a, const LLColor4 &b); // Returns distance between a and b diff --git a/indra/llmath/v4coloru.h b/indra/llmath/v4coloru.h index 7eb9a2929..3a313759d 100644 --- a/indra/llmath/v4coloru.h +++ b/indra/llmath/v4coloru.h @@ -139,7 +139,7 @@ public: static LLColor4U blue; }; -static_assert(std::is_trivially_copyable{}, "LLColor4U must be a trivially copyable type"); +static_assert(std::is_trivially_copyable::value, "LLColor4U must be a trivially copyable type"); // Non-member functions F32 distVec(const LLColor4U &a, const LLColor4U &b); // Returns distance between a and b diff --git a/indra/llmath/v4math.h b/indra/llmath/v4math.h index 5cfed4dc7..735636805 100644 --- a/indra/llmath/v4math.h +++ b/indra/llmath/v4math.h @@ -137,7 +137,7 @@ class LLVector4 friend LLVector4 operator-(const LLVector4 &a); // Return vector -a }; -static_assert(std::is_trivially_copyable{}, "LLVector4 must be a trivially copyable type"); +static_assert(std::is_trivially_copyable::value, "LLVector4 must be a trivially copyable type"); // Non-member functions F32 angle_between(const LLVector4 &a, const LLVector4 &b); // Returns angle (radians) between a and b diff --git a/indra/llprimitive/llmaterialid.h b/indra/llprimitive/llmaterialid.h index 8036db2d9..275939032 100644 --- a/indra/llprimitive/llmaterialid.h +++ b/indra/llprimitive/llmaterialid.h @@ -73,7 +73,7 @@ private: } ; static_assert(sizeof(LLMaterialID) == MATERIAL_ID_SIZE, "LLMaterialID must be sizeof(mID)"); -static_assert(std::is_trivially_copyable{}, "LLMaterialID must be a trivially copyable type"); +static_assert(std::is_trivially_copyable::value, "LLMaterialID must be a trivially copyable type"); #endif // LL_LLMATERIALID_H