File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 140
140
#define SWIFT_MUTATING \
141
141
__attribute__ ((swift_attr(" mutating" )))
142
142
143
+ // / Specifies that a specific c++ type such class or struct should be imported as type marked
144
+ // / as `@unchecked Sendable` type in swift. If this annotation is used, the type is therefore allowed to
145
+ // / use safely across async contexts.
146
+ // /
147
+ // / For example
148
+ // / ```
149
+ // / class SWIFT_UNCHECKED_SENDABLE CustomUserType
150
+ // / { ... }
151
+ // / ```
152
+ // / Will be imported as `struct CustomUserType: @unchecked Sendable`
153
+ #define SWIFT_UNCHECKED_SENDABLE \
154
+ __attribute__ ((swift_attr(" @Sendable)))
155
+
143
156
#else // #if _CXX_INTEROP_HAS_ATTRIBUTE(swift_attr)
144
157
145
158
// Empty defines for compilers that don't support `attribute(swift_attr)`.
151
164
#define SWIFT_NAME(_name)
152
165
#define SWIFT_CONFORMS_TO_PROTOCOL(_moduleName_protocolName)
153
166
#define SWIFT_COMPUTED_PROPERTY
154
- #define SWIFT_MUTATING
167
+ #define SWIFT_MUTATING
168
+ #define SWIFT_UNCHECKED_SENDABLE
155
169
156
170
#endif // #if _CXX_INTEROP_HAS_ATTRIBUTE(swift_attr)
157
171
You can’t perform that action at this time.
0 commit comments