hb-private.hh: Add fallback implementation for round()
Add a simplistic round() implementation for our purposes, used when the compiler does not support round() directly.
This commit is contained in:
parent
89dbabff65
commit
b9dcbb1f83
|
@ -1070,4 +1070,17 @@ struct hb_string_t
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/* fallback for round() */
|
||||||
|
#if !defined (HAVE_ROUND) && !defined (HAVE_DECL_ROUND)
|
||||||
|
static inline double
|
||||||
|
round (double x)
|
||||||
|
{
|
||||||
|
if (x >= 0)
|
||||||
|
return floor (x + 0.5);
|
||||||
|
else
|
||||||
|
return ceil (x - 0.5);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif /* HB_PRIVATE_HH */
|
#endif /* HB_PRIVATE_HH */
|
||||||
|
|
Loading…
Reference in New Issue