]> Savannah Git Hosting - gnulib.git/commitdiff
fma: Fix compilation error on Linux/sh4.
authorBruno Haible <bruno@clisp.org>
Sun, 29 Aug 2021 00:05:05 +0000 (02:05 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 29 Aug 2021 00:05:05 +0000 (02:05 +0200)
* lib/fma.c (FUNC): Don't test for FE_DOWNWARD or FE_UPWARD when these
rounding modes are not defined.

ChangeLog
lib/fma.c

index 12187eaf97ee4ca1d5af56bcc8932c9dceb5919b..599ce55eddd7cb15767386471a987563a698c7e6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-08-28  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        Skip some tests when running under QEMU user-mode.
index 3bddb30f3042ba93205e8289e912757897ad779e..bee05719c0f20e450a732b18947ebb5c2fb01769 100644 (file)
--- 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;