Skip to content

Commit 323bedd

Browse files
authored
[libc++][C++03] Add #if 0 to the experimental/ and ext/ headers as well (#119541)
This has already been done for the most headers in #119234, but I forgot to also do it for the experimental/ and ext/ headers. This is part of https://discourse.llvm.org/t/rfc-freezing-c-03-headers-in-libc.
1 parent ad0fbb0 commit 323bedd

File tree

8 files changed

+178
-154
lines changed

8 files changed

+178
-154
lines changed

libcxx/include/experimental/iterator

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -52,23 +52,25 @@ namespace std {
5252
5353
*/
5454

55-
#include <__config>
56-
#include <__memory/addressof.h>
57-
#include <__ostream/basic_ostream.h>
58-
#include <__string/char_traits.h>
59-
#include <__type_traits/decay.h>
60-
#include <__utility/forward.h>
61-
#include <__utility/move.h>
62-
#include <iterator>
63-
64-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
65-
# pragma GCC system_header
66-
#endif
55+
#if 0
56+
#else // 0
57+
# include <__config>
58+
# include <__memory/addressof.h>
59+
# include <__ostream/basic_ostream.h>
60+
# include <__string/char_traits.h>
61+
# include <__type_traits/decay.h>
62+
# include <__utility/forward.h>
63+
# include <__utility/move.h>
64+
# include <iterator>
65+
66+
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
67+
# pragma GCC system_header
68+
# endif
6769

6870
_LIBCPP_PUSH_MACROS
69-
#include <__undef_macros>
71+
# include <__undef_macros>
7072

71-
#if _LIBCPP_STD_VER >= 14
73+
# if _LIBCPP_STD_VER >= 14
7274

7375
_LIBCPP_BEGIN_NAMESPACE_LFTS
7476

@@ -117,14 +119,15 @@ make_ostream_joiner(basic_ostream<_CharT, _Traits>& __os, _Delim&& __d) {
117119

118120
_LIBCPP_END_NAMESPACE_LFTS
119121

120-
#endif // _LIBCPP_STD_VER >= 14
122+
# endif // _LIBCPP_STD_VER >= 14
121123

122124
_LIBCPP_POP_MACROS
123125

124-
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
125-
# include <cstddef>
126-
# include <iosfwd>
127-
# include <type_traits>
128-
#endif
126+
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
127+
# include <cstddef>
128+
# include <iosfwd>
129+
# include <type_traits>
130+
# endif
131+
#endif // 0
129132

130133
#endif // _LIBCPP_EXPERIMENTAL_ITERATOR

libcxx/include/experimental/memory

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -49,27 +49,29 @@ public:
4949
}
5050
*/
5151

52-
#include <__config>
53-
#include <__cstddef/nullptr_t.h>
54-
#include <__cstddef/size_t.h>
55-
#include <__functional/hash.h>
56-
#include <__functional/operations.h>
57-
#include <__type_traits/add_lvalue_reference.h>
58-
#include <__type_traits/add_pointer.h>
59-
#include <__type_traits/common_type.h>
60-
#include <__type_traits/enable_if.h>
61-
#include <__type_traits/is_convertible.h>
62-
#include <version>
63-
64-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
65-
# pragma GCC system_header
66-
#endif
67-
68-
#ifdef _LIBCPP_ENABLE_EXPERIMENTAL
52+
#if 0
53+
#else // 0
54+
# include <__config>
55+
# include <__cstddef/nullptr_t.h>
56+
# include <__cstddef/size_t.h>
57+
# include <__functional/hash.h>
58+
# include <__functional/operations.h>
59+
# include <__type_traits/add_lvalue_reference.h>
60+
# include <__type_traits/add_pointer.h>
61+
# include <__type_traits/common_type.h>
62+
# include <__type_traits/enable_if.h>
63+
# include <__type_traits/is_convertible.h>
64+
# include <version>
65+
66+
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
67+
# pragma GCC system_header
68+
# endif
69+
70+
# ifdef _LIBCPP_ENABLE_EXPERIMENTAL
6971

7072
_LIBCPP_BEGIN_NAMESPACE_LFTS_V2
7173

72-
# if _LIBCPP_STD_VER >= 17
74+
# if _LIBCPP_STD_VER >= 17
7375

7476
template <class _Wp>
7577
class observer_ptr {
@@ -172,30 +174,31 @@ _LIBCPP_HIDE_FROM_ABI bool operator>=(observer_ptr<_W1> __a, observer_ptr<_W2> _
172174
return !(__a < __b);
173175
}
174176

175-
# endif // _LIBCPP_STD_VER >= 17
177+
# endif // _LIBCPP_STD_VER >= 17
176178

177179
_LIBCPP_END_NAMESPACE_LFTS_V2
178180

179181
_LIBCPP_BEGIN_NAMESPACE_STD
180182

181183
// hash
182184

183-
# if _LIBCPP_STD_VER >= 17
185+
# if _LIBCPP_STD_VER >= 17
184186
template <class _Tp>
185187
struct hash<experimental::observer_ptr<_Tp>> {
186188
_LIBCPP_HIDE_FROM_ABI size_t operator()(const experimental::observer_ptr<_Tp>& __ptr) const noexcept {
187189
return hash<_Tp*>()(__ptr.get());
188190
}
189191
};
190-
# endif // _LIBCPP_STD_VER >= 17
192+
# endif // _LIBCPP_STD_VER >= 17
191193

192194
_LIBCPP_END_NAMESPACE_STD
193195

194-
#endif // _LIBCPP_ENABLE_EXPERIMENTAL
196+
# endif // _LIBCPP_ENABLE_EXPERIMENTAL
195197

196-
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
197-
# include <cstddef>
198-
# include <limits>
199-
#endif
198+
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
199+
# include <cstddef>
200+
# include <limits>
201+
# endif
202+
#endif // 0
200203

201204
#endif /* _LIBCPP_EXPERIMENTAL_MEMORY */

libcxx/include/experimental/propagate_const

Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -107,39 +107,41 @@
107107
108108
*/
109109

110-
#include <__config>
111-
#include <__cstddef/nullptr_t.h>
112-
#include <__cstddef/size_t.h>
113-
#include <__functional/operations.h>
114-
#include <__fwd/functional.h>
115-
#include <__type_traits/conditional.h>
116-
#include <__type_traits/decay.h>
117-
#include <__type_traits/enable_if.h>
118-
#include <__type_traits/is_array.h>
119-
#include <__type_traits/is_constructible.h>
120-
#include <__type_traits/is_convertible.h>
121-
#include <__type_traits/is_function.h>
122-
#include <__type_traits/is_pointer.h>
123-
#include <__type_traits/is_reference.h>
124-
#include <__type_traits/is_same.h>
125-
#include <__type_traits/is_swappable.h>
126-
#include <__type_traits/remove_cv.h>
127-
#include <__type_traits/remove_pointer.h>
128-
#include <__type_traits/remove_reference.h>
129-
#include <__utility/declval.h>
130-
#include <__utility/forward.h>
131-
#include <__utility/move.h>
132-
#include <__utility/swap.h>
133-
#include <version>
134-
135-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
136-
# pragma GCC system_header
137-
#endif
110+
#if 0
111+
#else // 0
112+
# include <__config>
113+
# include <__cstddef/nullptr_t.h>
114+
# include <__cstddef/size_t.h>
115+
# include <__functional/operations.h>
116+
# include <__fwd/functional.h>
117+
# include <__type_traits/conditional.h>
118+
# include <__type_traits/decay.h>
119+
# include <__type_traits/enable_if.h>
120+
# include <__type_traits/is_array.h>
121+
# include <__type_traits/is_constructible.h>
122+
# include <__type_traits/is_convertible.h>
123+
# include <__type_traits/is_function.h>
124+
# include <__type_traits/is_pointer.h>
125+
# include <__type_traits/is_reference.h>
126+
# include <__type_traits/is_same.h>
127+
# include <__type_traits/is_swappable.h>
128+
# include <__type_traits/remove_cv.h>
129+
# include <__type_traits/remove_pointer.h>
130+
# include <__type_traits/remove_reference.h>
131+
# include <__utility/declval.h>
132+
# include <__utility/forward.h>
133+
# include <__utility/move.h>
134+
# include <__utility/swap.h>
135+
# include <version>
136+
137+
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
138+
# pragma GCC system_header
139+
# endif
138140

139141
_LIBCPP_PUSH_MACROS
140-
#include <__undef_macros>
142+
# include <__undef_macros>
141143

142-
#if _LIBCPP_STD_VER >= 14
144+
# if _LIBCPP_STD_VER >= 14
143145

144146
_LIBCPP_BEGIN_NAMESPACE_LFTS_V2
145147

@@ -481,13 +483,14 @@ struct greater_equal<experimental::propagate_const<_Tp>> {
481483

482484
_LIBCPP_END_NAMESPACE_STD
483485

484-
#endif // _LIBCPP_STD_VER >= 14
486+
# endif // _LIBCPP_STD_VER >= 14
485487

486488
_LIBCPP_POP_MACROS
487489

488-
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
489-
# include <cstddef>
490-
# include <type_traits>
491-
#endif
490+
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
491+
# include <cstddef>
492+
# include <type_traits>
493+
# endif
494+
#endif // 0
492495

493496
#endif // _LIBCPP_EXPERIMENTAL_PROPAGATE_CONST

libcxx/include/experimental/simd

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,21 @@ inline namespace parallelism_v2 {
7575
# pragma GCC system_header
7676
#endif
7777

78-
#include <__config>
79-
#include <experimental/__simd/aligned_tag.h>
80-
#include <experimental/__simd/declaration.h>
81-
#include <experimental/__simd/reference.h>
82-
#include <experimental/__simd/scalar.h>
83-
#include <experimental/__simd/simd.h>
84-
#include <experimental/__simd/simd_mask.h>
85-
#include <experimental/__simd/traits.h>
86-
#include <experimental/__simd/vec_ext.h>
87-
88-
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
89-
# include <cstddef>
90-
#endif
78+
#if 0
79+
#else // 0
80+
# include <__config>
81+
# include <experimental/__simd/aligned_tag.h>
82+
# include <experimental/__simd/declaration.h>
83+
# include <experimental/__simd/reference.h>
84+
# include <experimental/__simd/scalar.h>
85+
# include <experimental/__simd/simd.h>
86+
# include <experimental/__simd/simd_mask.h>
87+
# include <experimental/__simd/traits.h>
88+
# include <experimental/__simd/vec_ext.h>
89+
90+
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
91+
# include <cstddef>
92+
# endif
93+
#endif // 0
9194

9295
#endif /* _LIBCPP_EXPERIMENTAL_SIMD */

libcxx/include/experimental/type_traits

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,18 @@ inline namespace fundamentals_v1 {
6868
6969
*/
7070

71-
#include <__config>
71+
#if 0
72+
#else // 0
73+
# include <__config>
7274

73-
#if _LIBCPP_STD_VER >= 14
75+
# if _LIBCPP_STD_VER >= 14
7476

75-
# include <initializer_list>
76-
# include <type_traits>
77+
# include <initializer_list>
78+
# include <type_traits>
7779

78-
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
79-
# pragma GCC system_header
80-
# endif
80+
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
81+
# pragma GCC system_header
82+
# endif
8183

8284
_LIBCPP_BEGIN_NAMESPACE_LFTS
8385

@@ -148,10 +150,11 @@ constexpr bool is_detected_convertible_v = is_detected_convertible<_To, _Op, _Ar
148150

149151
_LIBCPP_END_NAMESPACE_LFTS
150152

151-
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
152-
# include <cstddef>
153-
# endif
153+
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
154+
# include <cstddef>
155+
# endif
154156

155-
#endif /* _LIBCPP_STD_VER >= 14 */
157+
# endif /* _LIBCPP_STD_VER >= 14 */
158+
#endif // 0
156159

157160
#endif /* _LIBCPP_EXPERIMENTAL_TYPE_TRAITS */

libcxx/include/experimental/utility

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,24 @@ inline namespace fundamentals_v1 {
3030
3131
*/
3232

33-
#include <__config>
34-
#include <utility>
33+
#if 0
34+
#else // 0
35+
# include <__config>
36+
# include <utility>
3537

36-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
37-
# pragma GCC system_header
38-
#endif
38+
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
39+
# pragma GCC system_header
40+
# endif
3941

4042
_LIBCPP_BEGIN_NAMESPACE_LFTS
4143

4244
struct _LIBCPP_TEMPLATE_VIS erased_type {};
4345

4446
_LIBCPP_END_NAMESPACE_LFTS
4547

46-
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
47-
# include <cstddef>
48-
#endif
48+
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
49+
# include <cstddef>
50+
# endif
51+
#endif // 0
4952

5053
#endif /* _LIBCPP_EXPERIMENTAL_UTILITY */

0 commit comments

Comments
 (0)