Skip to content

Commit 5659471

Browse files
authored
[libc++] Fix build failure with libdispatch backend (#141606)
We get an error "cannot add 'abi_tag' attribute in a redeclaration" because functions like `__dispatch_apply` are first declared without an ABI tag due to `_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS` inside the header, and then redeclared with an ABI tag in the .cpp file.
1 parent 857ffa1 commit 5659471

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

libcxx/src/pstl/libdispatch.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <dispatch/dispatch.h>
1313

1414
_LIBCPP_BEGIN_NAMESPACE_STD
15+
_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
1516
namespace __pstl::__libdispatch {
1617

1718
void __dispatch_apply(size_t chunk_count, void* context, void (*func)(void* context, size_t chunk)) noexcept {
@@ -29,4 +30,5 @@ __chunk_partitions __partition_chunks(ptrdiff_t element_count) noexcept {
2930
}
3031

3132
} // namespace __pstl::__libdispatch
33+
_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
3234
_LIBCPP_END_NAMESPACE_STD

0 commit comments

Comments
 (0)