From: Bruno Haible Date: Sun, 29 Aug 2021 00:05:05 +0000 (+0200) Subject: fma: Fix compilation error on Linux/sh4. X-Git-Tag: v1.0~2634 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=798de454144208ea58a080c13c99f38c1166f0bd;p=gnulib.git fma: Fix compilation error on Linux/sh4. * lib/fma.c (FUNC): Don't test for FE_DOWNWARD or FE_UPWARD when these rounding modes are not defined. --- diff --git a/ChangeLog b/ChangeLog index 12187eaf97..599ce55edd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2021-08-28 Bruno Haible + + fma: Fix compilation error on Linux/sh4. + * lib/fma.c (FUNC): Don't test for FE_DOWNWARD or FE_UPWARD when these + rounding modes are not defined. + 2021-08-28 Bruno Haible Skip some tests when running under QEMU user-mode. diff --git a/lib/fma.c b/lib/fma.c index 3bddb30f30..bee05719c0 100644 --- a/lib/fma.c +++ b/lib/fma.c @@ -725,10 +725,14 @@ FUNC (DOUBLE x, DOUBLE y, DOUBLE z) int rounding_mode = fegetround (); if (rounding_mode == FE_TOWARDZERO) round_up = 0; +# if defined FE_DOWNWARD /* not defined on sh4 */ else if (rounding_mode == FE_DOWNWARD) round_up = sign; +# endif +# if defined FE_UPWARD /* not defined on sh4 */ else if (rounding_mode == FE_UPWARD) round_up = !sign; +# endif #else /* Cf. */ int rounding_mode = FLT_ROUNDS;