From c4cae81a26a816979f3206418c47856b5ed2d8bb Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Mon, 10 Jun 2019 15:32:54 +0430 Subject: [PATCH] Remove round polyfill Added in 01dff1e and 19256bef, this was targeted at older msvc versions that don't support C99 but now as we require C++11 we don't target places those envs thus removing this. --- CMakeLists.txt | 2 +- configure.ac | 6 ------ src/hb.hh | 14 -------------- 3 files changed, 1 insertion(+), 21 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ffabad10..cbff81e95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,7 +108,7 @@ endmacro () if (UNIX) list(APPEND CMAKE_REQUIRED_LIBRARIES m) endif () -check_funcs(atexit mprotect sysconf getpagesize mmap isatty newlocale strtod_l round) +check_funcs(atexit mprotect sysconf getpagesize mmap isatty newlocale strtod_l) check_include_file(unistd.h HAVE_UNISTD_H) if (${HAVE_UNISTD_H}) add_definitions(-DHAVE_UNISTD_H) diff --git a/configure.ac b/configure.ac index 6a68df79e..d48823d25 100644 --- a/configure.ac +++ b/configure.ac @@ -78,12 +78,6 @@ GTK_DOC_CHECK([1.15],[--flavour no-tmpl]) # Functions and headers AC_CHECK_FUNCS(atexit mprotect sysconf getpagesize mmap isatty newlocale strtod_l posix_memalign) - -save_libs="$LIBS" -LIBS="$LIBS -lm" -AC_CHECK_FUNCS([round], ,[AC_CHECK_DECLS([round], , ,[#include ])]) -LIBS="$save_libs" - AC_CHECK_HEADERS(unistd.h sys/mman.h xlocale.h stdbool.h) # Compiler flags diff --git a/src/hb.hh b/src/hb.hh index 33ad32311..0ee8ff57d 100644 --- a/src/hb.hh +++ b/src/hb.hh @@ -515,20 +515,6 @@ typedef uint64_t hb_vector_size_impl_t; #define VAR 1 -/* fallback for round() */ -static inline double -_hb_round (double x) -{ - if (x >= 0) - return floor (x + 0.5); - else - return ceil (x - 0.5); -} -#if !defined (HAVE_ROUND) && !defined (HAVE_DECL_ROUND) -#define round(x) _hb_round(x) -#endif - - /* fallback for posix_memalign() */ static inline int _hb_memalign(void **memptr, size_t alignment, size_t size)