From 9b7c7ae614a0865f613fc6b3f2596d86f23271bb Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Thu, 21 Feb 2013 15:50:54 +0800 Subject: [PATCH 1/1] 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 file changed, 12 insertions(+) diff --git a/gdk/fallback-c89.c b/gdk/fallback-c89.c index b150044bd..4baf797f3 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 -- 2.43.2