Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/swift/DispatchStubs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ extern "C" void * objc_retainAutoreleasedReturnValue(void *obj);
// eventually call swift_release to balance the retain below. This is a
// workaround until the compiler no longer emits this callout on non-ObjC
// platforms.
extern "C" void swift_retain(void *);
extern "C"
#if defined(_WIN32)
__declspec(dllimport)
#endif
void swift_retain(void *);

DISPATCH_RUNTIME_STDLIB_INTERFACE
extern "C" void * objc_retainAutoreleasedReturnValue(void *obj) {
Expand All @@ -78,4 +82,9 @@ extern "C" void * objc_retainAutoreleasedReturnValue(void *obj) {
else return NULL;
}

#if defined(_WIN32)
extern "C" void *(*__imp_objc_retainAutoreleasedReturnValue)(void *) =
&objc_retainAutoreleasedReturnValue;
#endif

#endif // !USE_OBJC