From 0a79fd42f9bfcc4c14dd10b2bd834495ce938060 Mon Sep 17 00:00:00 2001 From: Olivier Juan Date: Fri, 14 Sep 2018 16:05:49 +0200 Subject: [PATCH] fix compilation on older g++ using enum instead of constexpr --- libeft.hxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/libeft.hxx b/libeft.hxx index 8ce86ea..9d430af 100644 --- a/libeft.hxx +++ b/libeft.hxx @@ -169,13 +169,17 @@ private: // ** Split // Splitting factor used by split -template constexpr const Real splitFactor = 0. / 0.; // NaN +template struct splitFactor {}; // Double precision: ((2^27)+1), where 27 = sup(53/2) -template<> constexpr const double splitFactor = 134217729; +template<> struct splitFactor { + enum { value = 134217729 }; +}; // Single precision: ((2^12)+1), where 12 = 24/2 -template<> constexpr const float splitFactor = 4097; +template<> struct splitFactor { + enum { value = 4097 }; +}; // a = x + y // x = hi(a) @@ -185,7 +189,7 @@ static inline void split(const Intrinsic& ia, Intrinsic& ix, Intrins typedef const Intrinsic I; stopInstr(); - I ic = I(EFT::splitFactor) * ia; + I ic = I(EFT::splitFactor::value) * ia; ix = ic - (ic-ia); iy = ia - ix; startInstr();