File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 1818#ifndef SWIFT_CLANGIMPORTER_SWIFT_INTEROP_SUPPORT_H
1919#define SWIFT_CLANGIMPORTER_SWIFT_INTEROP_SUPPORT_H
2020
21+ #ifdef __has_attribute
22+ #define _CXX_INTEROP_HAS_ATTRIBUTE (x ) __has_attribute(x)
23+ #else
24+ #define _CXX_INTEROP_HAS_ATTRIBUTE (x ) 0
25+ #endif
26+
27+ #if _CXX_INTEROP_HAS_ATTRIBUTE(swift_attr)
28+
2129// / Specifies that a C++ `class` or `struct` owns and controls the lifetime of all
2230// / of the objects it references. Such type should not reference any objects whose
2331// / lifetime is controlled externally. This annotation allows Swift to import methods
125133#define SWIFT_COMPUTED_PROPERTY \
126134 __attribute__ ((swift_attr(" import_computed_property" )))
127135
136+ #else // #if _CXX_INTEROP_HAS_ATTRIBUTE(swift_attr)
137+
138+ // Empty defines for compilers that don't support `attribute(swift_attr)`.
139+ #define SWIFT_SELF_CONTAINED
140+ #define SWIFT_RETURNS_INDEPENDENT_VALUE
141+ #define SWIFT_SHARED_REFERENCE (_retain, _release )
142+ #define SWIFT_IMMORTAL_REFERENCE
143+ #define SWIFT_UNSAFE_REFERENCE
144+ #define SWIFT_NAME (_name )
145+ #define SWIFT_CONFORMS_TO_PROTOCOL (_moduleName_protocolName )
146+ #define SWIFT_COMPUTED_PROPERTY
147+
148+ #endif // #if _CXX_INTEROP_HAS_ATTRIBUTE(swift_attr)
149+
150+ #undef _CXX_INTEROP_HAS_ATTRIBUTE
151+
128152#endif // SWIFT_CLANGIMPORTER_SWIFT_INTEROP_SUPPORT_H
You can’t perform that action at this time.
0 commit comments