aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/ir_constant_expression.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/glsl/ir_constant_expression.cpp')
-rwxr-xr-x[-rw-r--r--]mesalib/src/glsl/ir_constant_expression.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/mesalib/src/glsl/ir_constant_expression.cpp b/mesalib/src/glsl/ir_constant_expression.cpp
index 3e30510a6..215c4a0ff 100644..100755
--- a/mesalib/src/glsl/ir_constant_expression.cpp
+++ b/mesalib/src/glsl/ir_constant_expression.cpp
@@ -40,19 +40,18 @@
#include "glsl_types.h"
#include "program/hash_table.h"
-#ifdef _MSC_VER
-#include <limits>
-
-inline bool isnormal(float x)
-{
- if(x < 0) x = -x;
- return x >= (std::numeric_limits<float>::min)()
- && x <= (std::numeric_limits<float>::max)();
-}
-inline float copysign(const float& x, const float& y)
-{
- return fabs(x) * ((y<0) ? -1 : 1);
-}
+#if defined(_MSC_VER) && (_MSC_VER < 1800)
+static int isnormal(double x)
+{
+ return _fpclass(x) == _FPCLASS_NN || _fpclass(x) == _FPCLASS_PN;
+}
+#endif
+
+#if defined(_MSC_VER)
+static double copysign(double x, double y)
+{
+ return _copysign(x, y);
+}
#endif
static float