Skip to content

Commit 22b1f1b

Browse files
authored
[libc] Remove #ifdef __cplusplus part from include/llvm-libc-macros/math-macros.h. (#87864)
Now with the proxy header `hdr/math_macros.h`, the header `include/llvm-libc-macros/math-macros.h` will not be included in overlay mode, and the extra definitions for `__cplusplus` mode is not needed any more.
1 parent 79343fa commit 22b1f1b

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

libc/include/llvm-libc-macros/math-macros.h

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -51,33 +51,9 @@
5151
#define math_errhandling (MATH_ERRNO | MATH_ERREXCEPT)
5252
#endif
5353

54-
// These must be type-generic functions. The C standard specifies them as
55-
// being macros rather than functions, in fact. However, in C++ it's important
56-
// that there be function declarations that don't interfere with other uses of
57-
// the identifier, even in places with parentheses where a function-like macro
58-
// will be expanded (such as a function declaration in a C++ namespace).
59-
6054
// TODO: Move generic functional math macros to a separate header file.
61-
#ifdef __cplusplus
62-
63-
template <typename T> inline constexpr bool isfinite(T x) {
64-
return __builtin_isfinite(x);
65-
}
66-
67-
template <typename T> inline constexpr bool isinf(T x) {
68-
return __builtin_isinf(x);
69-
}
70-
71-
template <typename T> inline constexpr bool isnan(T x) {
72-
return __builtin_isnan(x);
73-
}
74-
75-
#else
76-
7755
#define isfinite(x) __builtin_isfinite(x)
7856
#define isinf(x) __builtin_isinf(x)
7957
#define isnan(x) __builtin_isnan(x)
8058

81-
#endif
82-
8359
#endif // LLVM_LIBC_MACROS_MATH_MACROS_H

0 commit comments

Comments
 (0)