mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-21 23:11:04 +01:00
Make round() fallback portable to systems that do have round()
Makes compiling without HAVE_ROUND on systems that do have it work.
This commit is contained in:
1 parent
7db2e9ea38
commit
01dff1ea1a
1 file changed
+2
-1
+2
-1
@@ -1228,13 +1228,14 @@ struct hb_bytes_t
|
|||||||
/* fallback for round() */
|
/* fallback for round() */
|
||||||
#if !defined (HAVE_ROUND) && !defined (HAVE_DECL_ROUND)
|
#if !defined (HAVE_ROUND) && !defined (HAVE_DECL_ROUND)
|
||||||
static inline double
|
static inline double
|
||||||
round (double x)
|
_hb_round (double x)
|
||||||
{
|
{
|
||||||
if (x >= 0)
|
if (x >= 0)
|
||||||
return floor (x + 0.5);
|
return floor (x + 0.5);
|
||||||
else
|
else
|
||||||
return ceil (x - 0.5);
|
return ceil (x - 0.5);
|
||||||
}
|
}
|
||||||
|
#define round(x) _hb_round(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user