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
This commit is contained in:
Chun-wei Fan 2013-02-21 15:50:54 +08:00
parent 5e2c232145
commit 9b7c7ae614

View File

@ -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