|
15 | 15 | #include "src/__support/libc_errno.h" |
16 | 16 | #include "src/__support/macros/attributes.h" // LIBC_INLINE |
17 | 17 | #include "src/__support/macros/config.h" |
| 18 | +#include "src/__support/macros/optimization.h" |
18 | 19 | #include "src/__support/macros/properties/architectures.h" |
19 | 20 |
|
20 | 21 | #if defined(LIBC_TARGET_ARCH_IS_AARCH64) && defined(__ARM_FP) |
@@ -71,27 +72,35 @@ LIBC_INLINE int set_env(const fenv_t *) { return 0; } |
71 | 72 | namespace LIBC_NAMESPACE_DECL { |
72 | 73 | namespace fputil { |
73 | 74 |
|
74 | | -LIBC_INLINE int clear_except_if_required(int excepts) { |
| 75 | +LIBC_INLINE static int clear_except_if_required([[maybe_unused]] int excepts) { |
| 76 | +#ifndef LIBC_MATH_HAS_NO_EXCEPT |
75 | 77 | if (math_errhandling & MATH_ERREXCEPT) |
76 | 78 | return clear_except(excepts); |
| 79 | +#endif // LIBC_MATH_HAS_NO_EXCEPT |
77 | 80 | return 0; |
78 | 81 | } |
79 | 82 |
|
80 | | -LIBC_INLINE int set_except_if_required(int excepts) { |
| 83 | +LIBC_INLINE static int set_except_if_required([[maybe_unused]] int excepts) { |
| 84 | +#ifndef LIBC_MATH_HAS_NO_EXCEPT |
81 | 85 | if (math_errhandling & MATH_ERREXCEPT) |
82 | 86 | return set_except(excepts); |
| 87 | +#endif // LIBC_MATH_HAS_NO_EXCEPT |
83 | 88 | return 0; |
84 | 89 | } |
85 | 90 |
|
86 | | -LIBC_INLINE int raise_except_if_required(int excepts) { |
| 91 | +LIBC_INLINE static int raise_except_if_required([[maybe_unused]] int excepts) { |
| 92 | +#ifndef LIBC_MATH_HAS_NO_EXCEPT |
87 | 93 | if (math_errhandling & MATH_ERREXCEPT) |
88 | 94 | return raise_except(excepts); |
| 95 | +#endif // LIBC_MATH_HAS_NO_EXCEPT |
89 | 96 | return 0; |
90 | 97 | } |
91 | 98 |
|
92 | | -LIBC_INLINE void set_errno_if_required(int err) { |
| 99 | +LIBC_INLINE static void set_errno_if_required([[maybe_unused]] int err) { |
| 100 | +#ifndef LIBC_MATH_HAS_NO_ERRNO |
93 | 101 | if (math_errhandling & MATH_ERRNO) |
94 | 102 | libc_errno = err; |
| 103 | +#endif // LIBC_MATH_HAS_NO_ERRNO |
95 | 104 | } |
96 | 105 |
|
97 | 106 | } // namespace fputil |
|
0 commit comments