@@ -644,4 +644,14 @@ libc_feresetround_noex_ctx (struct rm_ctx *ctx)
SET_RESTORE_ROUND_GENERIC (RM, libc_feholdsetround_53bit, \
libc_feresetround_53bit)
+/* When no floating-point exceptions are defined in <fenv.h>, make
+ feraiseexcept ignore its argument so that unconditional
+ feraiseexcept calls do not cause errors for undefined exceptions.
+ Define it to expand to a void expression so that any calls testing
+ the result of feraiseexcept do produce errors. */
+#if FE_ALL_EXCEPT == 0
+# define feraiseexcept(excepts) ((void) 0)
+# define __feraiseexcept(excepts) ((void) 0)
+#endif
+
#endif /* _MATH_PRIVATE_H_ */
@@ -30,9 +30,7 @@
success in every case.
The overrides for libc_ functions must happen before we include
- the generic math_private.h, and the overrides for regular
- <fenv.h> functions must happen afterwards, to avoid clashing with
- the declarations of those functions. */
+ the generic math_private.h. */
#define libc_fesetround(rnd) ({ 0; })
#define libc_fetestexcept(exc) ({ 0; })
@@ -45,8 +43,4 @@
#include_next <math_private.h>
-#define feraiseexcept(excepts) ({ 0; })
-#define __feraiseexcept(excepts) ({ 0; })
-#define feclearexcept(exc) ({ 0; })
-
#endif
@@ -17,9 +17,7 @@
success in every case.
The overrides for libc_ functions must happen before we include
- the generic math_private.h, and the overrides for regular
- <fenv.h> functions must happen afterwards, to avoid clashing with
- the declarations of those functions. */
+ the generic math_private.h. */
#define libc_fesetround(rnd) ({ 0; })
#define libc_fetestexcept(exc) ({ 0; })
@@ -32,8 +30,4 @@
#include_next <math_private.h>
-#define feraiseexcept(excepts) ({ 0; })
-#define __feraiseexcept(excepts) ({ 0; })
-#define feclearexcept(exc) ({ 0; })
-
#endif
@@ -16,9 +16,7 @@
success in every case.
The overrides for libc_ functions must happen before we include
- the generic math_private.h, and the overrides for regular
- <fenv.h> functions must happen afterwards, to avoid clashing with
- the declarations of those functions. */
+ the generic math_private.h. */
#define libc_fesetround(rnd) ({ 0; })
#define libc_fetestexcept(exc) ({ 0; })
@@ -31,8 +29,4 @@
#include_next <math_private.h>
-#define feraiseexcept(excepts) ({ 0; })
-#define __feraiseexcept(excepts) ({ 0; })
-#define feclearexcept(exc) ({ 0; })
-
#endif
@@ -26,10 +26,6 @@
#include_next <math_private.h>
-#define feraiseexcept(excepts) ({ 0; })
-#define __feraiseexcept(excepts) ({ 0; })
-#define feclearexcept(exc) ({ 0; })
-#define fetestexcept(exc) ({ 0; })
extern inline int fegetenv (fenv_t *__e) { return 0; }
extern inline int __fegetenv (fenv_t *__e) { return 0; }
extern inline int fesetenv (const fenv_t *__e) { return 0; }