From 5beeeb81c77cbcf72a7b9635fbad87e69432e6fd Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 29 Oct 2017 10:49:55 +0100 Subject: math: Fix test failure on Haiku. --- lib/math.in.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'lib/math.in.h') diff --git a/lib/math.in.h b/lib/math.in.h index f220151602..09f822aa5e 100644 --- a/lib/math.in.h +++ b/lib/math.in.h @@ -194,8 +194,17 @@ _NaN () #endif -/* Ensure FP_ILOGB0 and FP_ILOGBNAN are defined. */ -#if !(defined FP_ILOGB0 && defined FP_ILOGBNAN) +#if defined FP_ILOGB0 && defined FP_ILOGBNAN + /* Ensure FP_ILOGB0 and FP_ILOGBNAN are correct. */ +# if defined __HAIKU__ + /* Haiku: match what ilogb() does */ +# undef FP_ILOGB0 +# undef FP_ILOGBNAN +# define FP_ILOGB0 (- 2147483647 - 1) /* INT_MIN */ +# define FP_ILOGBNAN (- 2147483647 - 1) /* INT_MIN */ +# endif +#else + /* Ensure FP_ILOGB0 and FP_ILOGBNAN are defined. */ # if defined __NetBSD__ || defined __sgi /* NetBSD, IRIX 6.5: match what ilogb() does */ # define FP_ILOGB0 (- 2147483647 - 1) /* INT_MIN */ -- cgit v1.2.1