From a783840789c93add42e4d70fdb407eb4ad6e062e Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 27 Jun 2020 22:23:59 -0700 Subject: [PATCH] Always round up Fixes https://github.com/harfbuzz/harfbuzz/issues/2496 --- configure.ac | 2 +- src/hb.hh | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index 9fe75ed19..e933476ed 100644 --- a/configure.ac +++ b/configure.ac @@ -68,7 +68,7 @@ GTK_DOC_CHECK([1.15],[--flavour no-tmpl]) ]) # Functions and headers -AC_CHECK_FUNCS(atexit mprotect sysconf getpagesize mmap isatty roundf) +AC_CHECK_FUNCS(atexit mprotect sysconf getpagesize mmap isatty) AC_CHECK_HEADERS(unistd.h sys/mman.h stdbool.h) # Compiler flags diff --git a/src/hb.hh b/src/hb.hh index 3adca88ff..b798ef609 100644 --- a/src/hb.hh +++ b/src/hb.hh @@ -499,14 +499,9 @@ static_assert ((sizeof (hb_var_int_t) == 4), ""); #define HB_VAR_ARRAY 1 #endif -static inline double -_hb_roundf (float x) -{ - return x >= 0 ? floor ((double) x + .5) : ceil ((double) x - .5); -} -#ifndef HAVE_ROUNDF +static inline float +_hb_roundf (float x) { return floorf (x + .5f); } #define roundf(x) _hb_roundf(x) -#endif /* Endian swap, used in Windows related backends */ static inline uint16_t hb_uint16_swap (const uint16_t v)