diff --git a/src/hb-private.hh b/src/hb-private.hh index daa496e98cde7c45cae7f2a5e0c87c89473e3d10..62a103cf7a38c8735c53d6773e63cf2299a3dd7c 100644 --- a/src/hb-private.hh +++ b/src/hb-private.hh @@ -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 */