Skip to content

Commit 695cb55

Browse files
authored
[libc++] Remove obsolete header restrictions for _LIBCPP_HAS_NO_THREADS (#107437)
The _LIBCPP_HAS_NO_THREADS carve-out does not result in hard errors anymore, but the patch that changed that forgot to update the header restrictions we use to auto-generate several files. We can also remove the restrictions for the no-localization build and no-wide-characters, but doing it is less straightforward so I'm leaving it out of this patch.
1 parent 3a0ef2a commit 695cb55

File tree

3 files changed

+14
-51
lines changed

3 files changed

+14
-51
lines changed

libcxx/include/__std_clang_module

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@
3333
#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
3434
# include <atomic>
3535
#endif
36-
#if !defined(_LIBCPP_HAS_NO_THREADS)
37-
# include <barrier>
38-
#endif
36+
#include <barrier>
3937
#include <bit>
4038
#include <bitset>
4139
#include <cassert>
@@ -101,9 +99,7 @@
10199
# include <fstream>
102100
#endif
103101
#include <functional>
104-
#if !defined(_LIBCPP_HAS_NO_THREADS)
105-
# include <future>
106-
#endif
102+
#include <future>
107103
#include <initializer_list>
108104
#include <inttypes.h>
109105
#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
@@ -120,9 +116,7 @@
120116
# include <istream>
121117
#endif
122118
#include <iterator>
123-
#if !defined(_LIBCPP_HAS_NO_THREADS)
124-
# include <latch>
125-
#endif
119+
#include <latch>
126120
#include <limits>
127121
#include <list>
128122
#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
@@ -153,13 +147,9 @@
153147
# include <regex>
154148
#endif
155149
#include <scoped_allocator>
156-
#if !defined(_LIBCPP_HAS_NO_THREADS)
157-
# include <semaphore>
158-
#endif
150+
#include <semaphore>
159151
#include <set>
160-
#if !defined(_LIBCPP_HAS_NO_THREADS)
161-
# include <shared_mutex>
162-
#endif
152+
#include <shared_mutex>
163153
#include <source_location>
164154
#include <span>
165155
#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
@@ -175,9 +165,7 @@
175165
#include <stdint.h>
176166
#include <stdio.h>
177167
#include <stdlib.h>
178-
#if !defined(_LIBCPP_HAS_NO_THREADS)
179-
# include <stop_token>
180-
#endif
168+
#include <stop_token>
181169
#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
182170
# include <streambuf>
183171
#endif
@@ -192,9 +180,7 @@
192180
#endif
193181
#include <system_error>
194182
#include <tgmath.h>
195-
#if !defined(_LIBCPP_HAS_NO_THREADS)
196-
# include <thread>
197-
#endif
183+
#include <thread>
198184
#include <tuple>
199185
#include <type_traits>
200186
#include <typeindex>

libcxx/modules/std.cppm.in

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ module;
2323
#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
2424
# include <atomic>
2525
#endif
26-
#if !defined(_LIBCPP_HAS_NO_THREADS)
27-
# include <barrier>
28-
#endif
26+
#include <barrier>
2927
#include <bit>
3028
#include <bitset>
3129
#include <cassert>
@@ -76,9 +74,7 @@ module;
7674
# include <fstream>
7775
#endif
7876
#include <functional>
79-
#if !defined(_LIBCPP_HAS_NO_THREADS)
80-
# include <future>
81-
#endif
77+
#include <future>
8278
#include <initializer_list>
8379
#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
8480
# include <iomanip>
@@ -94,9 +90,7 @@ module;
9490
# include <istream>
9591
#endif
9692
#include <iterator>
97-
#if !defined(_LIBCPP_HAS_NO_THREADS)
98-
# include <latch>
99-
#endif
93+
#include <latch>
10094
#include <limits>
10195
#include <list>
10296
#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
@@ -123,23 +117,17 @@ module;
123117
# include <regex>
124118
#endif
125119
#include <scoped_allocator>
126-
#if !defined(_LIBCPP_HAS_NO_THREADS)
127-
# include <semaphore>
128-
#endif
120+
#include <semaphore>
129121
#include <set>
130-
#if !defined(_LIBCPP_HAS_NO_THREADS)
131-
# include <shared_mutex>
132-
#endif
122+
#include <shared_mutex>
133123
#include <source_location>
134124
#include <span>
135125
#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
136126
# include <sstream>
137127
#endif
138128
#include <stack>
139129
#include <stdexcept>
140-
#if !defined(_LIBCPP_HAS_NO_THREADS)
141-
# include <stop_token>
142-
#endif
130+
#include <stop_token>
143131
#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
144132
# include <streambuf>
145133
#endif
@@ -152,9 +140,7 @@ module;
152140
# include <syncstream>
153141
#endif
154142
#include <system_error>
155-
#if !defined(_LIBCPP_HAS_NO_THREADS)
156-
# include <thread>
157-
#endif
143+
#include <thread>
158144
#include <tuple>
159145
#include <type_traits>
160146
#include <typeindex>

libcxx/utils/libcxx/header_information.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,6 @@
3131
"strstream": "!defined(_LIBCPP_HAS_NO_LOCALIZATION)",
3232
"syncstream": "!defined(_LIBCPP_HAS_NO_LOCALIZATION)",
3333

34-
# headers with #error directives
35-
"barrier": "!defined(_LIBCPP_HAS_NO_THREADS)",
36-
"future": "!defined(_LIBCPP_HAS_NO_THREADS)",
37-
"latch": "!defined(_LIBCPP_HAS_NO_THREADS)",
38-
"semaphore": "!defined(_LIBCPP_HAS_NO_THREADS)",
39-
"shared_mutex": "!defined(_LIBCPP_HAS_NO_THREADS)",
40-
"stop_token": "!defined(_LIBCPP_HAS_NO_THREADS)",
41-
"thread": "!defined(_LIBCPP_HAS_NO_THREADS)",
42-
4334
# headers with #error directives
4435
"wchar.h": "!defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)",
4536
"wctype.h": "!defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)",

0 commit comments

Comments
 (0)