Skip to content

Commit 1f91d95

Browse files
[runtime] Use __has_extension to detect swiftasynccc availability
`swiftasynccc` is now an extension instead of a feature, so we should use `__has_extension` to detect its availability.
1 parent f95fd21 commit 1f91d95

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

include/swift/Runtime/Config.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,12 @@ extern uintptr_t __COMPATIBILITY_LIBRARIES_CANNOT_CHECK_THE_IS_SWIFT_BIT_DIRECTL
228228

229229
// SWIFT_CC(swiftasync) is the Swift async calling convention.
230230
// We assume that it supports mandatory tail call elimination.
231-
#if __has_feature(swiftasynccc) && __has_attribute(swiftasynccall)
232-
#define SWIFT_CC_swiftasync __attribute__((swiftasynccall))
231+
#if __has_attribute(swiftasynccall)
232+
# if __has_feature(swiftasynccc) || __has_extension(swiftasynccc)
233+
# define SWIFT_CC_swiftasync __attribute__((swiftasynccall))
234+
# else
235+
# define SWIFT_CC_swiftasync SWIFT_CC_swift
236+
# endif
233237
#else
234238
#define SWIFT_CC_swiftasync SWIFT_CC_swift
235239
#endif

0 commit comments

Comments
 (0)