From 01dff1ea1aa871fa19a92c2afd63c8cb5dd6e455 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 26 Jun 2018 18:00:58 -0400 Subject: [PATCH] Make round() fallback portable to systems that do have round() Makes compiling without HAVE_ROUND on systems that do have it work. --- src/hb-private.hh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hb-private.hh b/src/hb-private.hh index 32e335495..91162f93a 100644 --- a/src/hb-private.hh +++ b/src/hb-private.hh @@ -1228,13 +1228,14 @@ struct hb_bytes_t /* fallback for round() */ #if !defined (HAVE_ROUND) && !defined (HAVE_DECL_ROUND) static inline double -round (double x) +_hb_round (double x) { if (x >= 0) return floor (x + 0.5); else return ceil (x - 0.5); } +#define round(x) _hb_round(x) #endif