Skip to content

Commit

Permalink
Merge pull request #1 from Genaro-Chris/Genaro-Chris-patch-1
Browse files Browse the repository at this point in the history
Update bridging
  • Loading branch information
Genaro-Chris committed Oct 31, 2023
2 parents a8d43c7 + 190f050 commit 49ea89d
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion lib/ClangImporter/bridging
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,19 @@
#define SWIFT_MUTATING \
__attribute__((swift_attr("mutating")))

/// Specifies that a specific c++ type such class or struct should be imported as type marked
/// as `@unchecked Sendable` type in swift. If this annotation is used, the type is therefore allowed to
/// use safely across async contexts.
///
/// For example
/// ```
/// class SWIFT_UNCHECKED_SENDABLE CustomUserType
/// { ... }
/// ```
/// Will be imported as `struct CustomUserType: @unchecked Sendable`
#define SWIFT_UNCHECKED_SENDABLE \
__attribute__((swift_attr("@Sendable)))
#else // #if _CXX_INTEROP_HAS_ATTRIBUTE(swift_attr)
// Empty defines for compilers that don't support `attribute(swift_attr)`.
Expand All @@ -151,7 +164,8 @@
#define SWIFT_NAME(_name)
#define SWIFT_CONFORMS_TO_PROTOCOL(_moduleName_protocolName)
#define SWIFT_COMPUTED_PROPERTY
#define SWIFT_MUTATING
#define SWIFT_MUTATING
#define SWIFT_UNCHECKED_SENDABLE
#endif // #if _CXX_INTEROP_HAS_ATTRIBUTE(swift_attr)
Expand Down

0 comments on commit 49ea89d

Please sign in to comment.