[libcxx-commits] [libcxxabi] [libcxx] [libc++] Remove dependence on <ciso646> (PR #73271)
Michael Kenzel via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Nov 29 17:59:38 PST 2023
================
@@ -12,15 +12,15 @@
// Attempt to get STL specific macros like _LIBCPP_VERSION using the most
// minimal header possible. If we're testing libc++, we should use `<__config>`.
-// If <__config> isn't available, fall back to <ciso646>.
+// If <__config> isn't available, fall back to <version>.
#ifdef __has_include
# if __has_include("<__config>")
# include <__config>
# define TEST_IMP_INCLUDED_HEADER
# endif
#endif
#ifndef TEST_IMP_INCLUDED_HEADER
-#include <ciso646>
+# include <version>
----------------
michael-kenzel wrote:
I have now replaced this whole part
```cpp
// Attempt to get STL specific macros like _LIBCPP_VERSION using the most
// minimal header possible. If we're testing libc++, we should use `<__config>`.
// If <__config> isn't available, fall back to <ciso646>.
#ifdef __has_include
# if __has_include("<__config>")
# include <__config>
# define TEST_IMP_INCLUDED_HEADER
# endif
#endif
#ifndef TEST_IMP_INCLUDED_HEADER
#include <ciso646>
#endif
```
with just
```cpp
#ifdef __has_include
# if __has_include("<version>")
# include <version>
# else
# include <ciso646>
# endif
#else
# include <ciso646>
#endif
```
It doesn't seem necessary to explicitly check and include `__config.h` since `<version.h>` already does that for libc++, so this seemed like a valid simplification?
https://github.com/llvm/llvm-project/pull/73271
More information about the libcxx-commits
mailing list