[libc++] Avoid including <features.h> on arbitrary platforms (#125587) · llvm/llvm-project@876a5c9 (original) (raw)
File tree
1 file changed
lines changed
- libcxx/include/__configuration
1 file changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -30,12 +30,9 @@ | ||
30 | 30 | // ... add new file formats here ... |
31 | 31 | #endif |
32 | 32 | |
33 | -// To detect which libc we're using | |
34 | -#if __has_include(<features.h>) | |
33 | +// Need to detect which libc we're using if we're on Linux. | |
34 | +#if defined(__linux__) | | |
35 | 35 | # include <features.h> |
36 | -#endif | |
37 | - | |
38 | -#if defined(__linux__) | |
39 | 36 | # if defined(__GLIBC_PREREQ) |
40 | 37 | # define _LIBCPP_GLIBC_PREREQ(a, b) __GLIBC_PREREQ(a, b) |
41 | 38 | # else |