mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-20 06:21:16 +01:00
Fallback if roundf didn't exist, like in dietlibc (#1953)
This commit is contained in:
1 parent
d3b984d379
commit
d50d2fcbc7
2 files changed
+10
-1
No files matched your search
+1
-1
@@ -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)
|
||||
check_funcs(atexit mprotect sysconf getpagesize mmap isatty newlocale strtod_l roundf)
|
||||
check_include_file(unistd.h HAVE_UNISTD_H)
|
||||
if (${HAVE_UNISTD_H})
|
||||
add_definitions(-DHAVE_UNISTD_H)
|
||||
|
||||
@@ -477,6 +477,15 @@ static_assert ((sizeof (hb_var_int_t) == 4), "");
|
||||
/* Size signifying variable-sized array */
|
||||
#define VAR 1
|
||||
|
||||
static inline double
|
||||
_hb_roundf (float x)
|
||||
{
|
||||
return x >= 0 ? floor ((double) x + .5) : ceil ((double) x - .5);
|
||||
}
|
||||
#ifndef HAVE_ROUNDF
|
||||
#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)
|
||||
{ return (v >> 8) | (v << 8); }
|
||||
|
||||
Reference in new issue
Block a user