summaryrefslogtreecommitdiff
path: root/dev-lang/swift/files/swift-5.10.1-r5/backport-swift-75662.patch
blob: 7044f9022a9655c578f2bac29df5a661853359d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# A backport of https://github.com/swiftlang/swift/pull/75662, to avoid cyclic
# header dependencies when `dev-cpp/tbb` is installed. Since Gentoo no longer
# supports GCC <11 (and we explicitly require >=11 in the ebuild), we avoid
# including `<execution>` and picking up the tbb headers if they're present.
#
# See https://bugs.gentoo.org/947141

--- a/swift/stdlib/public/Cxx/libstdcxx/libstdcxx.h
+++ b/swift/stdlib/public/Cxx/libstdcxx/libstdcxx.h
@@ -1,7 +1,10 @@
+#include "cstddef"
+
 // C++17 and newer:

 // <execution> includes tbb headers, which might not be installed.
 // Only include <execution> if tbb is installed.
-#if __has_include("execution") && __has_include(<tbb/blocked_range.h>)
+#if __has_include("execution") && __has_include(<tbb/blocked_range.h>) && (!defined(_GLIBCXX_RELEASE) || (_GLIBCXX_RELEASE < 11))
 #include "execution"
 #endif
+