Skip to content

Commit

Permalink
workaround for VS2010/VS2012 codegen bug
Browse files Browse the repository at this point in the history
  • Loading branch information
rainers committed Jun 1, 2013
1 parent 5ca18a6 commit 7d1aae0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/root/longdouble.h
Expand Up @@ -121,7 +121,14 @@ inline longdouble ldouble(unsigned long long mantissa, int exp, int sign = 0)
d.sign = sign;
return d;
}
template<typename T> inline longdouble ldouble(T x) { longdouble d; d.set(x); return d; }

#if _MSC_VER >= 1600 && defined(_DEBUG)
#define LDOUBLE_INLINE __declspec(noinline) // codegen bug in VS2010/VS2012, if set function not inlined (this passed on stack, but expected in ECX; RVO?)
#else
#define LDOUBLE_INLINE inline
#endif

template<typename T> LDOUBLE_INLINE longdouble ldouble(T x) { longdouble d; d.set(x); return d; }

longdouble operator+(longdouble ld1, longdouble ld2);
longdouble operator-(longdouble ld1, longdouble ld2);
Expand Down

0 comments on commit 7d1aae0

Please sign in to comment.