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:
@ -53,4 +53,15 @@ rint (double x)
|
|||||||
return ceil (x - 0.5);
|
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
|
||||||
|
Reference in New Issue
Block a user