[gtk+] gtkcssnumbervalue.c: Include fallback-c89.c to fix build



commit c0bc0a9ac2cee05ef12ecc41b71debecdded8602
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Wed Dec 23 18:58:42 2015 +0800

    gtkcssnumbervalue.c: Include fallback-c89.c to fix build
    
    ... on older Visual Studio versions, where isinf() is not available, and
    copy the isinf() implementation from gdk/fallback-c89.c to
    gtk/fallback-c89.c.

 gtk/fallback-c89.c      |   12 ++++++++++++
 gtk/gtkcssnumbervalue.c |    4 ++--
 2 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/gtk/fallback-c89.c b/gtk/fallback-c89.c
index aaccd9d..e87bf76 100644
--- a/gtk/fallback-c89.c
+++ b/gtk/fallback-c89.c
@@ -65,3 +65,15 @@ nearbyint (double x)
   return floor (x + 0.5);
 }
 #endif
+
+#ifndef HAVE_DECL_ISINF
+/* Unfortunately MSVC does not have finite()
+ * but it does have _finite() which is the same
+ * as finite() except when x is a NaN
+ */
+static inline gboolean
+isinf (double x)
+{
+  return (!_finite (x) && !_isnan (x));
+}
+#endif
diff --git a/gtk/gtkcssnumbervalue.c b/gtk/gtkcssnumbervalue.c
index 5db0758..49bd67c 100644
--- a/gtk/gtkcssnumbervalue.c
+++ b/gtk/gtkcssnumbervalue.c
@@ -17,14 +17,14 @@
 
 #include "config.h"
 
-#include <math.h>
-
 #include "gtkcssnumbervalueprivate.h"
 
 #include "gtkcssenumvalueprivate.h"
 #include "gtkcssinitialvalueprivate.h"
 #include "gtkstylepropertyprivate.h"
 
+#include "fallback-c89.c"
+
 struct _GtkCssValue {
   GTK_CSS_VALUE_BASE
   GtkCssUnit unit;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]