Remove round polyfill
authorEbrahim Byagowi <ebrahim@gnu.org>
Mon, 10 Jun 2019 11:02:54 +0000 (15:32 +0430)
committerBehdad Esfahbod <behdad@behdad.org>
Mon, 10 Jun 2019 19:49:50 +0000 (12:49 -0700)
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
configure.ac
src/hb.hh

index 4ffabad..cbff81e 100644 (file)
@@ -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)
index 6a68df7..d48823d 100644 (file)
@@ -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 <math.h>])])
-LIBS="$save_libs"
-
 AC_CHECK_HEADERS(unistd.h sys/mman.h xlocale.h stdbool.h)
 
 # Compiler flags
index 33ad323..0ee8ff5 100644 (file)
--- 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)