summaryrefslogtreecommitdiff
path: root/core/math/math_funcs.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/math/math_funcs.h')
-rw-r--r--core/math/math_funcs.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/math/math_funcs.h b/core/math/math_funcs.h
index c98a088912..28a8413325 100644
--- a/core/math/math_funcs.h
+++ b/core/math/math_funcs.h
@@ -136,7 +136,10 @@ public:
static int b;
-#if defined(_MSC_VER) && _MSC_VER < 1800
+#if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0603 // windows 8?
+ b = (int)((a>0.0f) ? (a + 0.5f):(a -0.5f));
+
+#elif defined(_MSC_VER) && _MSC_VER < 1800
__asm fld a
__asm fistp b
/*#elif defined( __GNUC__ ) && ( defined( __i386__ ) || defined( __x86_64__ ) )
@@ -147,6 +150,7 @@ public:
"fistpl %0 \n\t"
: "=m" (b)
: "m" (a));*/
+
#else
b=lrintf(a); //assuming everything but msvc 2012 or earlier has lrint
#endif