diff options
| author | Juan Linietsky | 2017-06-13 19:17:13 -0300 |
|---|---|---|
| committer | GitHub | 2017-06-13 19:17:13 -0300 |
| commit | a8e845a474c01c4cde1416ed00e6ae456786c1fb (patch) | |
| tree | 073d311971752a8fbd3df72def311c6f70e8e8de /core/math/math_funcs.h | |
| parent | a8a1f2e2a864e6b58d5bcf1c7e53a43cdb6d95d9 (diff) | |
| parent | 6a9c990da72a737fa95d9e97d53f835706aea7c3 (diff) | |
| download | godot-a8e845a474c01c4cde1416ed00e6ae456786c1fb.tar.gz godot-a8e845a474c01c4cde1416ed00e6ae456786c1fb.tar.zst godot-a8e845a474c01c4cde1416ed00e6ae456786c1fb.zip | |
Diffstat (limited to 'core/math/math_funcs.h')
| -rw-r--r-- | core/math/math_funcs.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/core/math/math_funcs.h b/core/math/math_funcs.h index ca960aaba..dd64b10f8 100644 --- a/core/math/math_funcs.h +++ b/core/math/math_funcs.h @@ -110,6 +110,15 @@ public: static _ALWAYS_INLINE_ bool is_inf(double p_val) { #ifdef _MSC_VER return !_finite(p_val); +// workaround for mingw builds on travis +#elif defined(__MINGW32__) || defined(__MINGW64__) + union { + uint64_t u; + double f; + } ieee754; + ieee754.f = p_val; + return ((unsigned)(ieee754.u >> 32) & 0x7fffffff) == 0x7ff00000 && + ((unsigned)ieee754.u == 0); #else return isinf(p_val); #endif @@ -118,6 +127,14 @@ public: static _ALWAYS_INLINE_ bool is_inf(float p_val) { #ifdef _MSC_VER return !_finite(p_val); +// workaround for mingw builds on travis +#elif defined(__MINGW32__) || defined(__MINGW64__) + union { + uint32_t u; + float f; + } ieee754; + ieee754.f = p_val; + return (ieee754.u & 0x7fffffff) == 0x7f800000; #else return isinf(p_val); #endif |
