From c47d610ae27e89911539773f15bd7940fc00d35d Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 17 Feb 2024 12:56:52 -0800 Subject: Use autoconf to check for float.h instead of platform-specific ifdefs Signed-off-by: Alan Coopersmith --- configure.ac | 4 ++-- src/util/fontxlfd.c | 9 ++------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 690682d..3436796 100644 --- a/configure.ac +++ b/configure.ac @@ -67,8 +67,8 @@ AC_CHECK_FUNCS([poll readlink strlcat]) AC_CONFIG_LIBOBJ_DIR([src/util]) AC_REPLACE_FUNCS([reallocarray realpath strlcat strlcpy]) -# Check for BSDish err.h -AC_CHECK_HEADERS([err.h]) +# Checks for header files. +AC_CHECK_HEADERS([err.h float.h]) # Checks for typedefs, structures, and compiler characteristics. AC_SYS_LARGEFILE diff --git a/src/util/fontxlfd.c b/src/util/fontxlfd.c index f37e253..b232c36 100644 --- a/src/util/fontxlfd.c +++ b/src/util/fontxlfd.c @@ -183,12 +183,7 @@ xlfd_round_double(double x) significant digits. How do you round to n significant digits on a binary machine? */ -#if defined(i386) || defined(__i386__) || \ - defined(ia64) || defined(__ia64__) || \ - defined(__alpha__) || defined(__alpha) || \ - defined(__hppa__) || \ - defined(__amd64__) || defined(__amd64) || \ - defined(sgi) +#ifdef HAVE_FLOAT_H #include /* if we have IEEE 754 fp, we can round to binary digits... */ @@ -249,7 +244,7 @@ xlfd_round_double(double x) } else #endif -#endif /* i386 || __i386__ */ +#endif /* HAVE_FLOAT_H */ { /* * If not IEEE 754: Let printf() do it for you. -- cgit v1.2.3