[gtk+] gdk/fallback-c89.c: Add fallback for round()



commit 9b7c7ae614a0865f613fc6b3f2596d86f23271bb
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Thu Feb 21 15:50:54 2013 +0800

    gdk/fallback-c89.c: Add fallback for round()
    
    This is essentially done by simply copying from gtk/fallback-c89.c
    
    https://bugzilla.gnome.org/show_bug.cgi?id=694339

 gdk/fallback-c89.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/gdk/fallback-c89.c b/gdk/fallback-c89.c
index b150044..4baf797 100644
--- a/gdk/fallback-c89.c
+++ b/gdk/fallback-c89.c
@@ -42,3 +42,15 @@ isinf (double x)
   return (!_finite (x) && !_isnan (x));
 }
 #endif
+
+/* Workaround for round() for non-GCC/non-C99 compilers */
+#ifndef HAVE_ROUND
+static inline double
+round (double x)
+{
+  if (x >= 0)
+    return floor (x + 0.5);
+  else
+    return ceil (x - 0.5);
+}
+#endif


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