summaryrefslogtreecommitdiffstats
path: root/core/math
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-06-13 19:17:13 -0300
committerGitHub <noreply@github.com>2017-06-13 19:17:13 -0300
commita8e845a474c01c4cde1416ed00e6ae456786c1fb (patch)
tree073d311971752a8fbd3df72def311c6f70e8e8de /core/math
parenta8a1f2e2a864e6b58d5bcf1c7e53a43cdb6d95d9 (diff)
parent6a9c990da72a737fa95d9e97d53f835706aea7c3 (diff)
downloadredot-engine-a8e845a474c01c4cde1416ed00e6ae456786c1fb.tar.gz
Merge pull request #8548 from tagcup/etc2comp
Add ETC1/ETC2 compression support though etc2comp.
Diffstat (limited to 'core/math')
-rw-r--r--core/math/math_funcs.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/math/math_funcs.h b/core/math/math_funcs.h
index ca960aabad..dd64b10f88 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