Bug 670499-gtk/fallback-c89.c: Add fallback for nearbyint()

This adds a C89 implementation for nearbyint() as it is a function that
is only made available in C99.
This commit is contained in:
Chun-wei Fan 2012-04-05 22:55:15 +08:00
parent a5626c489e
commit 5f61f40601

View File

@ -53,4 +53,15 @@ rint (double x)
return ceil (x - 0.5);
}
}
#endif
#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