summaryrefslogtreecommitdiff
path: root/gtk/fallback-c89.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/fallback-c89.c')
-rw-r--r--gtk/fallback-c89.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gtk/fallback-c89.c b/gtk/fallback-c89.c
index eb713b8b35..aaccd9d0ce 100644
--- a/gtk/fallback-c89.c
+++ b/gtk/fallback-c89.c
@@ -53,4 +53,15 @@ rint (double x)
return ceil (x - 0.5);
}
}
-#endif \ No newline at end of file
+#endif
+
+#ifndef HAVE_NEARBYINT
+/* Workaround for nearbyint() for non-GCC/non-C99 compilers */
+/* This is quite similar to rint() in most respects */
+
+static inline double
+nearbyint (double x)
+{
+ return floor (x + 0.5);
+}
+#endif