Skip to content

Commit 43dc4a4

Browse files
committed
[libc++] Make the __availability header a sub-header of __config
In essence, this header has always been related to configuration of the library but we didn't want to put it inside <__config> due to complexity reasons. Now that we have sub-headers in <__config>, we can move <__availability> to it and stop including it everywhere since we already obtain the required macros via <__config>.
1 parent 6fb366f commit 43dc4a4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+9
-63
lines changed

libcxx/include/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,6 @@ set(files
234234
__atomic/kill_dependency.h
235235
__atomic/memory_order.h
236236
__atomic/to_gcc_order.h
237-
__availability
238237
__bit/bit_cast.h
239238
__bit/bit_ceil.h
240239
__bit/bit_floor.h
@@ -330,6 +329,7 @@ set(files
330329
__condition_variable/condition_variable.h
331330
__config
332331
__configuration/abi.h
332+
__configuration/availability.h
333333
__configuration/compiler.h
334334
__configuration/platform.h
335335
__coroutine/coroutine_handle.h

libcxx/include/__atomic/atomic_base.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include <__atomic/cxx_atomic_impl.h>
1515
#include <__atomic/is_always_lock_free.h>
1616
#include <__atomic/memory_order.h>
17-
#include <__availability>
1817
#include <__config>
1918
#include <__memory/addressof.h>
2019
#include <__type_traits/is_integral.h>

libcxx/include/__atomic/atomic_flag.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include <__atomic/contention_t.h>
1414
#include <__atomic/cxx_atomic_impl.h>
1515
#include <__atomic/memory_order.h>
16-
#include <__availability>
1716
#include <__chrono/duration.h>
1817
#include <__config>
1918
#include <__memory/addressof.h>

libcxx/include/__atomic/atomic_sync.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include <__atomic/cxx_atomic_impl.h>
1414
#include <__atomic/memory_order.h>
1515
#include <__atomic/to_gcc_order.h>
16-
#include <__availability>
1716
#include <__chrono/duration.h>
1817
#include <__config>
1918
#include <__memory/addressof.h>

libcxx/include/__charconv/to_chars_floating_point.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#ifndef _LIBCPP___CHARCONV_TO_CHARS_FLOATING_POINT_H
1111
#define _LIBCPP___CHARCONV_TO_CHARS_FLOATING_POINT_H
1212

13-
#include <__availability>
1413
#include <__charconv/chars_format.h>
1514
#include <__charconv/to_chars_result.h>
1615
#include <__config>

libcxx/include/__chrono/file_clock.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#ifndef _LIBCPP___CHRONO_FILE_CLOCK_H
1111
#define _LIBCPP___CHRONO_FILE_CLOCK_H
1212

13-
#include <__availability>
1413
#include <__chrono/duration.h>
1514
#include <__chrono/system_clock.h>
1615
#include <__chrono/time_point.h>

libcxx/include/__config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#include <__config_site>
1414
#include <__configuration/abi.h>
15+
#include <__configuration/availability.h>
1516
#include <__configuration/compiler.h>
1617
#include <__configuration/platform.h>
1718

libcxx/include/__availability renamed to libcxx/include/__configuration/availability.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
//
88
//===----------------------------------------------------------------------===//
99

10-
#ifndef _LIBCPP___AVAILABILITY
11-
#define _LIBCPP___AVAILABILITY
10+
#ifndef _LIBCPP___CONFIGURATION_AVAILABILITY_H
11+
#define _LIBCPP___CONFIGURATION_AVAILABILITY_H
1212

13-
#include <__config>
13+
#include <__configuration/compiler.h>
14+
#include <__configuration/language.h>
1415

1516
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
1617
# pragma GCC system_header
@@ -374,4 +375,4 @@
374375
# define _LIBCPP_AVAILABILITY_INIT_PRIMARY_EXCEPTION
375376
#endif
376377

377-
#endif // _LIBCPP___AVAILABILITY
378+
#endif // _LIBCPP___CONFIGURATION_AVAILABILITY_H

libcxx/include/__exception/exception_ptr.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#ifndef _LIBCPP___EXCEPTION_EXCEPTION_PTR_H
1010
#define _LIBCPP___EXCEPTION_EXCEPTION_PTR_H
1111

12-
#include <__availability>
1312
#include <__config>
1413
#include <__exception/operations.h>
1514
#include <__memory/addressof.h>

libcxx/include/__expected/bad_expected_access.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#ifndef _LIBCPP___EXPECTED_BAD_EXPECTED_ACCESS_H
1010
#define _LIBCPP___EXPECTED_BAD_EXPECTED_ACCESS_H
1111

12-
#include <__availability>
1312
#include <__config>
1413
#include <__exception/exception.h>
1514
#include <__utility/move.h>

libcxx/include/__filesystem/directory_entry.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#ifndef _LIBCPP___FILESYSTEM_DIRECTORY_ENTRY_H
1111
#define _LIBCPP___FILESYSTEM_DIRECTORY_ENTRY_H
1212

13-
#include <__availability>
1413
#include <__chrono/time_point.h>
1514
#include <__compare/ordering.h>
1615
#include <__config>

libcxx/include/__filesystem/directory_iterator.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#define _LIBCPP___FILESYSTEM_DIRECTORY_ITERATOR_H
1212

1313
#include <__assert>
14-
#include <__availability>
1514
#include <__config>
1615
#include <__filesystem/directory_entry.h>
1716
#include <__filesystem/directory_options.h>

libcxx/include/__filesystem/filesystem_error.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#ifndef _LIBCPP___FILESYSTEM_FILESYSTEM_ERROR_H
1111
#define _LIBCPP___FILESYSTEM_FILESYSTEM_ERROR_H
1212

13-
#include <__availability>
1413
#include <__config>
1514
#include <__filesystem/path.h>
1615
#include <__memory/shared_ptr.h>

libcxx/include/__filesystem/operations.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#ifndef _LIBCPP___FILESYSTEM_OPERATIONS_H
1111
#define _LIBCPP___FILESYSTEM_OPERATIONS_H
1212

13-
#include <__availability>
1413
#include <__chrono/time_point.h>
1514
#include <__config>
1615
#include <__filesystem/copy_options.h>

libcxx/include/__filesystem/path.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
#include <__algorithm/replace.h>
1414
#include <__algorithm/replace_copy.h>
15-
#include <__availability>
1615
#include <__config>
1716
#include <__functional/unary_function.h>
1817
#include <__fwd/functional.h>

libcxx/include/__filesystem/path_iterator.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#define _LIBCPP___FILESYSTEM_PATH_ITERATOR_H
1212

1313
#include <__assert>
14-
#include <__availability>
1514
#include <__config>
1615
#include <__filesystem/path.h>
1716
#include <__iterator/iterator_traits.h>

libcxx/include/__filesystem/recursive_directory_iterator.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#ifndef _LIBCPP___FILESYSTEM_RECURSIVE_DIRECTORY_ITERATOR_H
1111
#define _LIBCPP___FILESYSTEM_RECURSIVE_DIRECTORY_ITERATOR_H
1212

13-
#include <__availability>
1413
#include <__config>
1514
#include <__filesystem/directory_entry.h>
1615
#include <__filesystem/directory_options.h>

libcxx/include/__filesystem/u8path.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#define _LIBCPP___FILESYSTEM_U8PATH_H
1212

1313
#include <__algorithm/unwrap_iter.h>
14-
#include <__availability>
1514
#include <__config>
1615
#include <__filesystem/path.h>
1716
#include <string>

libcxx/include/__functional/function.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#define _LIBCPP___FUNCTIONAL_FUNCTION_H
1212

1313
#include <__assert>
14-
#include <__availability>
1514
#include <__config>
1615
#include <__exception/exception.h>
1716
#include <__functional/binary_function.h>

libcxx/include/__fwd/memory_resource.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#ifndef _LIBCPP___FWD_MEMORY_RESOURCE_H
1010
#define _LIBCPP___FWD_MEMORY_RESOURCE_H
1111

12-
#include <__availability>
1312
#include <__config>
1413

1514
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)

libcxx/include/__fwd/string.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#ifndef _LIBCPP___FWD_STRING_H
1010
#define _LIBCPP___FWD_STRING_H
1111

12-
#include <__availability>
1312
#include <__config>
1413
#include <__fwd/memory.h>
1514
#include <__fwd/memory_resource.h>

libcxx/include/__memory_resource/memory_resource.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#ifndef _LIBCPP___MEMORY_RESOURCE_MEMORY_RESOURCE_H
1010
#define _LIBCPP___MEMORY_RESOURCE_MEMORY_RESOURCE_H
1111

12-
#include <__availability>
1312
#include <__config>
1413
#include <__fwd/memory_resource.h>
1514
#include <cstddef>

libcxx/include/__memory_resource/monotonic_buffer_resource.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#ifndef _LIBCPP___MEMORY_RESOURCE_MONOTONIC_BUFFER_RESOURCE_H
1010
#define _LIBCPP___MEMORY_RESOURCE_MONOTONIC_BUFFER_RESOURCE_H
1111

12-
#include <__availability>
1312
#include <__config>
1413
#include <__memory/addressof.h>
1514
#include <__memory_resource/memory_resource.h>

libcxx/include/__memory_resource/polymorphic_allocator.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#define _LIBCPP___MEMORY_RESOURCE_POLYMORPHIC_ALLOCATOR_H
1111

1212
#include <__assert>
13-
#include <__availability>
1413
#include <__config>
1514
#include <__fwd/pair.h>
1615
#include <__memory_resource/memory_resource.h>

libcxx/include/__memory_resource/synchronized_pool_resource.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#ifndef _LIBCPP___MEMORY_RESOURCE_SYNCHRONIZED_POOL_RESOURCE_H
1010
#define _LIBCPP___MEMORY_RESOURCE_SYNCHRONIZED_POOL_RESOURCE_H
1111

12-
#include <__availability>
1312
#include <__config>
1413
#include <__memory_resource/memory_resource.h>
1514
#include <__memory_resource/pool_options.h>

libcxx/include/__memory_resource/unsynchronized_pool_resource.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#ifndef _LIBCPP___MEMORY_RESOURCE_UNSYNCHRONIZED_POOL_RESOURCE_H
1010
#define _LIBCPP___MEMORY_RESOURCE_UNSYNCHRONIZED_POOL_RESOURCE_H
1111

12-
#include <__availability>
1312
#include <__config>
1413
#include <__memory_resource/memory_resource.h>
1514
#include <__memory_resource/pool_options.h>

libcxx/include/__ostream/print.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#ifndef _LIBCPP___OSTREAM_PRINT_H
1010
#define _LIBCPP___OSTREAM_PRINT_H
1111

12-
#include <__availability>
1312
#include <__config>
1413
#include <__fwd/ostream.h>
1514
#include <__iterator/ostreambuf_iterator.h>

libcxx/include/__stop_token/stop_callback.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#ifndef _LIBCPP___STOP_TOKEN_STOP_CALLBACK_H
1111
#define _LIBCPP___STOP_TOKEN_STOP_CALLBACK_H
1212

13-
#include <__availability>
1413
#include <__concepts/constructible.h>
1514
#include <__concepts/destructible.h>
1615
#include <__concepts/invocable.h>

libcxx/include/__stop_token/stop_source.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#ifndef _LIBCPP___STOP_TOKEN_STOP_SOURCE_H
1111
#define _LIBCPP___STOP_TOKEN_STOP_SOURCE_H
1212

13-
#include <__availability>
1413
#include <__config>
1514
#include <__stop_token/intrusive_shared_ptr.h>
1615
#include <__stop_token/stop_state.h>

libcxx/include/__stop_token/stop_state.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#define _LIBCPP___STOP_TOKEN_STOP_STATE_H
1212

1313
#include <__assert>
14-
#include <__availability>
1514
#include <__config>
1615
#include <__stop_token/atomic_unique_lock.h>
1716
#include <__stop_token/intrusive_list_view.h>

libcxx/include/__stop_token/stop_token.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#ifndef _LIBCPP___STOP_TOKEN_STOP_TOKEN_H
1111
#define _LIBCPP___STOP_TOKEN_STOP_TOKEN_H
1212

13-
#include <__availability>
1413
#include <__config>
1514
#include <__stop_token/intrusive_shared_ptr.h>
1615
#include <__stop_token/stop_state.h>

libcxx/include/__thread/jthread.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#ifndef _LIBCPP___THREAD_JTHREAD_H
1111
#define _LIBCPP___THREAD_JTHREAD_H
1212

13-
#include <__availability>
1413
#include <__config>
1514
#include <__functional/invoke.h>
1615
#include <__stop_token/stop_source.h>

libcxx/include/__thread/poll_with_backoff.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#ifndef _LIBCPP___THREAD_POLL_WITH_BACKOFF_H
1111
#define _LIBCPP___THREAD_POLL_WITH_BACKOFF_H
1212

13-
#include <__availability>
1413
#include <__chrono/duration.h>
1514
#include <__chrono/high_resolution_clock.h>
1615
#include <__config>

libcxx/include/__verbose_abort

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#ifndef _LIBCPP___VERBOSE_ABORT
1111
#define _LIBCPP___VERBOSE_ABORT
1212

13-
#include <__availability>
1413
#include <__config>
1514

1615
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)

libcxx/include/barrier

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ namespace std
5454
#include <__assert>
5555
#include <__atomic/atomic_base.h>
5656
#include <__atomic/memory_order.h>
57-
#include <__availability>
5857
#include <__memory/unique_ptr.h>
5958
#include <__thread/poll_with_backoff.h>
6059
#include <__thread/timed_backoff_policy.h>

libcxx/include/condition_variable

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ public:
118118
119119
*/
120120

121-
#include <__availability>
122121
#include <__chrono/duration.h>
123122
#include <__chrono/steady_clock.h>
124123
#include <__chrono/time_point.h>

libcxx/include/deque

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ template <class T, class Allocator, class Predicate>
189189
#include <__algorithm/remove_if.h>
190190
#include <__algorithm/unwrap_iter.h>
191191
#include <__assert>
192-
#include <__availability>
193192
#include <__config>
194193
#include <__debug_utils/sanitizers.h>
195194
#include <__format/enable_insertable.h>

libcxx/include/forward_list

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ template <class T, class Allocator, class Predicate>
199199
#include <__algorithm/lexicographical_compare.h>
200200
#include <__algorithm/lexicographical_compare_three_way.h>
201201
#include <__algorithm/min.h>
202-
#include <__availability>
203202
#include <__config>
204203
#include <__iterator/distance.h>
205204
#include <__iterator/iterator_traits.h>

libcxx/include/fstream

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ typedef basic_fstream<wchar_t> wfstream;
188188

189189
#include <__algorithm/max.h>
190190
#include <__assert>
191-
#include <__availability>
192191
#include <__config>
193192
#include <__fwd/fstream.h>
194193
#include <__locale>

libcxx/include/latch

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ namespace std
5050
#include <__atomic/atomic_base.h>
5151
#include <__atomic/atomic_sync.h>
5252
#include <__atomic/memory_order.h>
53-
#include <__availability>
5453
#include <cstddef>
5554
#include <limits>
5655
#include <version>

libcxx/include/list

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ template <class T, class Allocator, class Predicate>
203203
#include <__algorithm/lexicographical_compare_three_way.h>
204204
#include <__algorithm/min.h>
205205
#include <__assert>
206-
#include <__availability>
207206
#include <__config>
208207
#include <__format/enable_insertable.h>
209208
#include <__iterator/distance.h>

libcxx/include/map

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,6 @@ erase_if(multimap<Key, T, Compare, Allocator>& c, Predicate pred); // C++20
575575
#include <__algorithm/lexicographical_compare.h>
576576
#include <__algorithm/lexicographical_compare_three_way.h>
577577
#include <__assert>
578-
#include <__availability>
579578
#include <__config>
580579
#include <__functional/binary_function.h>
581580
#include <__functional/is_transparent.h>

libcxx/include/module.modulemap

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -570,10 +570,6 @@ module std_private_assert [system] {
570570
header "__assert"
571571
export *
572572
}
573-
module std_private_availability [system] {
574-
header "__availability"
575-
export *
576-
}
577573
module std_private_bit_reference [system] {
578574
header "__bit_reference"
579575
export *
@@ -584,6 +580,7 @@ module std_private_fwd_bit_reference [system] {
584580
module std_private_config [system] {
585581
textual header "__config"
586582
textual header "__configuration/abi.h"
583+
textual header "__configuration/availability.h"
587584
textual header "__configuration/compiler.h"
588585
textual header "__configuration/platform.h"
589586
export *

libcxx/include/optional

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ namespace std {
178178
*/
179179

180180
#include <__assert>
181-
#include <__availability>
182181
#include <__compare/compare_three_way_result.h>
183182
#include <__compare/three_way_comparable.h>
184183
#include <__concepts/invocable.h>

libcxx/include/print

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ namespace std {
3434
*/
3535

3636
#include <__assert>
37-
#include <__availability>
3837
#include <__concepts/same_as.h>
3938
#include <__config>
4039
#include <__system_error/system_error.h>

libcxx/include/regex

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,6 @@ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
792792
#include <__algorithm/find.h>
793793
#include <__algorithm/search.h>
794794
#include <__assert>
795-
#include <__availability>
796795
#include <__config>
797796
#include <__iterator/back_insert_iterator.h>
798797
#include <__iterator/default_sentinel.h>

0 commit comments

Comments
 (0)