summaryrefslogtreecommitdiff
path: root/lib/fma.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2021-08-29 02:05:05 +0200
committerBruno Haible <bruno@clisp.org>2021-08-29 02:05:05 +0200
commit798de454144208ea58a080c13c99f38c1166f0bd (patch)
tree50da6585ce3ec07e3077b5be358af1bee477d28d /lib/fma.c
parent8bc60373667bbca9a991a9a675635a8049b94e2c (diff)
downloadgnulib-798de454144208ea58a080c13c99f38c1166f0bd.tar.gz
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.
Diffstat (limited to 'lib/fma.c')
-rw-r--r--lib/fma.c4
1 files changed, 4 insertions, 0 deletions
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. <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/float.h.html> */
int rounding_mode = FLT_ROUNDS;