[Mesa-dev] [PATCH] glsl: Define isnormal and copysign for MSVC to fix build.

Vinson Lee vlee at freedesktop.org
Fri Sep 20 18:03:40 PDT 2013


Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69541
Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 src/glsl/ir_constant_expression.cpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/glsl/ir_constant_expression.cpp b/src/glsl/ir_constant_expression.cpp
index 4579ef2..805e1f3 100644
--- a/src/glsl/ir_constant_expression.cpp
+++ b/src/glsl/ir_constant_expression.cpp
@@ -40,6 +40,18 @@
 #include "glsl_types.h"
 #include "program/hash_table.h"
 
+#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
 dot(ir_constant *op0, ir_constant *op1)
 {
-- 
1.8.1.2



More information about the mesa-dev mailing list