summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2015-12-23 18:58:42 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2015-12-23 19:23:17 +0800
commitc0bc0a9ac2cee05ef12ecc41b71debecdded8602 (patch)
treea78a47bb2a837edcf96d75ffce30e95205a76331
parentd0d8671c02dad52b54867c9ed92f47e1cba17df1 (diff)
downloadgtk+-c0bc0a9ac2cee05ef12ecc41b71debecdded8602.tar.gz
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.
-rw-r--r--gtk/fallback-c89.c12
-rw-r--r--gtk/gtkcssnumbervalue.c4
2 files changed, 14 insertions, 2 deletions
diff --git a/gtk/fallback-c89.c b/gtk/fallback-c89.c
index aaccd9d0ce..e87bf76c0c 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 5db0758535..49bd67cd7e 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;