mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-16 13:40:31 +00:00
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:
parent
a5626c489e
commit
5f61f40601
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user