Skip to content

Commit dba89d2

Browse files
committed
Revert upstream trunk change to CoreFoundation that breaks the SDK build
1 parent 26b63c3 commit dba89d2

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

.github/workflows/sdks.yml

+1
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ jobs:
128128
sed -i "s%abort(void) %abort(void);// %" android-ndk-r23/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/stdlib.h
129129
elif [ ${{ matrix.version }} = 'trunk' ]; then
130130
EXTRA_FLAGS="--skip-early-swift-driver"
131+
git apply foundation-trunk-fix.patch
131132
fi
132133
133134
./swift/utils/build-script -RA --skip-build-cmark --build-llvm=0 --android --android-ndk $NDK --android-arch ${{ matrix.arch }} --android-api-level $ANDROID_API_LEVEL --android-icu-uc $SDK/usr/lib/libicuuc.so --android-icu-uc-include $SDK/usr/include --android-icu-i18n $SDK/usr/lib/libicui18n.so --android-icu-i18n-include $SDK/usr/include --android-icu-data $SDK/usr/lib/libicudata.so --build-swift-tools=0 --native-swift-tools-path=`pwd`/$SWIFT_TAG-ubuntu20.04/usr/bin --native-clang-tools-path=$NDK/toolchains/llvm/prebuilt/linux-x86_64/bin --cross-compile-hosts=android-${{ matrix.arch }} --cross-compile-deps-path=$SDK --skip-local-build --xctest --install-swift --install-libdispatch --install-foundation --install-xctest --install-destdir=$SDK --swift-install-components='clang-resource-dir-symlink;license;stdlib;sdk-overlay' $EXTRA_FLAGS

foundation-trunk-fix.patch

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
diff --git a/swift-corelibs-foundation/CoreFoundation/Base.subproj/CFAvailability.h b/swift-corelibs-foundation/CoreFoundation/Base.subproj/CFAvailability.h
2+
index d790782a..ef4b6edb 100644
3+
--- a/swift-corelibs-foundation/CoreFoundation/Base.subproj/CFAvailability.h
4+
+++ b/swift-corelibs-foundation/CoreFoundation/Base.subproj/CFAvailability.h
5+
@@ -135,13 +135,13 @@
6+
#define __CF_ENUM_FIXED_IS_AVAILABLE (__cplusplus && __cplusplus >= 201103L && (__has_extension(cxx_strong_enums) || __has_feature(objc_fixed_enum))) || (!__cplusplus && (__has_feature(objc_fixed_enum) || __has_extension(cxx_fixed_enum)))
7+
8+
#if __CF_ENUM_FIXED_IS_AVAILABLE
9+
-#define __CF_NAMED_ENUM(_type, _name) enum __CF_ENUM_ATTRIBUTES _name : _type _name; enum _name : _type
10+
+#define __CF_NAMED_ENUM(_type, _name) int __CF_ENUM_ ## _name; enum __CF_ENUM_ATTRIBUTES _name : _type; typedef enum _name _name; enum _name : _type
11+
#define __CF_ANON_ENUM(_type) enum __CF_ENUM_ATTRIBUTES : _type
12+
-#define CF_CLOSED_ENUM(_type, _name) enum __CF_CLOSED_ENUM_ATTRIBUTES _name : _type _name; enum _name : _type
13+
+#define CF_CLOSED_ENUM(_type, _name) int __CF_ENUM_ ## _name; enum __CF_CLOSED_ENUM_ATTRIBUTES _name : _type; typedef enum _name _name; enum _name : _type
14+
#if (__cplusplus)
15+
#define CF_OPTIONS(_type, _name) _type _name; enum __CF_OPTIONS_ATTRIBUTES : _type
16+
#else
17+
-#define CF_OPTIONS(_type, _name) enum __CF_OPTIONS_ATTRIBUTES _name : _type _name; enum _name : _type
18+
+#define CF_OPTIONS(_type, _name) int __CF_OPTIONS_ ## _name; enum __CF_OPTIONS_ATTRIBUTES _name : _type; typedef enum _name _name; enum _name : _type
19+
#endif
20+
#else
21+
#define __CF_NAMED_ENUM(_type, _name) _type _name; enum

0 commit comments

Comments
 (0)