Skip to content

Commit 0365677

Browse files
[libc++] Remove dependence on <ciso646> (#73271)
C++23 removed `<ciso646>` from the standard library. The header is used in a few places in order to pull in implementation-specific and feature test macros. The new way of doing that is `<version>`, which should be supported by all supported implementations. This change replaces all those uses of `<ciso646>` with `<version>`.
1 parent 88fbc4d commit 0365677

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

libcxx/test/support/container_debug_tests.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
#ifndef TEST_SUPPORT_CONTAINER_DEBUG_TESTS_H
1010
#define TEST_SUPPORT_CONTAINER_DEBUG_TESTS_H
1111

12-
#include <ciso646>
12+
#include "test_macros.h"
13+
1314
#ifndef _LIBCPP_VERSION
1415
#error This header may only be used for libc++ tests
1516
#endif
@@ -25,7 +26,6 @@
2526

2627
#include "check_assertion.h"
2728
#include "test_allocator.h"
28-
#include "test_macros.h"
2929

3030
// These test make use of 'if constexpr'.
3131
#if TEST_STD_VER <= 14

libcxx/test/support/test_macros.h

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,14 @@
1010
#ifndef SUPPORT_TEST_MACROS_HPP
1111
#define SUPPORT_TEST_MACROS_HPP
1212

13-
// Attempt to get STL specific macros like _LIBCPP_VERSION using the most
14-
// minimal header possible. If we're testing libc++, we should use `<__config>`.
15-
// If <__config> isn't available, fall back to <ciso646>.
1613
#ifdef __has_include
17-
# if __has_include("<__config>")
18-
# include <__config>
19-
# define TEST_IMP_INCLUDED_HEADER
20-
# endif
21-
#endif
22-
#ifndef TEST_IMP_INCLUDED_HEADER
23-
#include <ciso646>
14+
# if __has_include("<version>")
15+
# include <version>
16+
# else
17+
# include <ciso646>
18+
# endif
19+
#else
20+
# include <ciso646>
2421
#endif
2522

2623
#define TEST_STRINGIZE_IMPL(...) #__VA_ARGS__

libcxxabi/src/demangle/DemangleConfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include "../abort_message.h"
2020
#endif
2121

22-
#include <ciso646>
22+
#include <version>
2323

2424
#ifdef _MSC_VER
2525
// snprintf is implemented in VS 2015

0 commit comments

Comments
 (0)