Native: add missing stubs for objc for non-objc targets

Kotlin code for Objective-C interop is always included to stdlib.
It depends on some C++ code. The latter is compiled conditionally -
only for targets supporting Objective-C interop. That might cause
undefined symbols problems when DCE is not enabled.

To deal with it, we usually have trivial stubs in C++ code, used
for targets not supporting Objective-C interop.

This commit adds a couple of such missing stubs.
This commit is contained in:
Troels Bjerre Lund
2023-12-08 11:43:45 +00:00
committed by Space Cloud
parent 58678c09e8
commit f1b6c2df45
@@ -3,16 +3,16 @@
* that can be found in the LICENSE file.
*/
#import "Memory.h"
#import "ObjCExport.h"
#import "ObjCExportErrors.h"
#if KONAN_OBJC_INTEROP
#import <pthread.h>
#import <Foundation/NSException.h>
#import <Foundation/NSObject.h>
#import "Memory.h"
#import "ObjCExport.h"
#import "ObjCExportErrors.h"
typedef void (^Completion)(id _Nullable, NSError* _Nullable);
extern "C" void Kotlin_ObjCExport_runCompletionSuccess(KRef completionHolder, KRef result) {
@@ -79,4 +79,18 @@ extern "C" void Kotlin_ObjCExport_resumeContinuation(KRef continuation, KRef res
}
}
#else
extern "C" void Kotlin_ObjCExport_runCompletionSuccess(KRef completionHolder, KRef result) {
RuntimeAssert(false, "Unavailable operation");
}
extern "C" void Kotlin_ObjCExport_runCompletionFailure(
KRef completionHolder,
KRef exception,
const TypeInfo** exceptionTypes
) {
RuntimeAssert(false, "Unavailable operation");
}
#endif