From 35be7055e13454e63354a829a8e6c70a67a30a50 Mon Sep 17 00:00:00 2001 From: Svyatoslav Scherbina Date: Mon, 25 Jun 2018 19:25:07 +0300 Subject: [PATCH] Remove obsolete code used for Objective-C interop --- .../kotlin/kotlinx/cinterop/ObjectiveCImpl.kt | 10 ------- runtime/src/main/cpp/ObjCInteropUtils.mm | 28 ------------------- 2 files changed, 38 deletions(-) diff --git a/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/ObjectiveCImpl.kt b/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/ObjectiveCImpl.kt index 0c8d10d7eb8..9bc04d0634c 100644 --- a/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/ObjectiveCImpl.kt +++ b/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/ObjectiveCImpl.kt @@ -174,16 +174,6 @@ external fun CreateNSStringFromKString(str: String?): NativePtr @SymbolName("Kotlin_Interop_CreateKStringFromNSString") external fun CreateKStringFromNSString(ptr: NativePtr): String? -@SymbolName("Kotlin_Interop_ObjCToString") -private external fun ObjCToString(ptr: NativePtr): String - -@SymbolName("Kotlin_Interop_ObjCHashCode") -private external fun ObjCHashCode(ptr: NativePtr): Int - -@SymbolName("Kotlin_Interop_ObjCEquals") -private external fun ObjCEquals(ptr: NativePtr, otherPtr: NativePtr): Boolean - - // Objective-C runtime: @SymbolName("objc_retainAutoreleaseReturnValue") diff --git a/runtime/src/main/cpp/ObjCInteropUtils.mm b/runtime/src/main/cpp/ObjCInteropUtils.mm index 31475373ed3..ee60e78643a 100644 --- a/runtime/src/main/cpp/ObjCInteropUtils.mm +++ b/runtime/src/main/cpp/ObjCInteropUtils.mm @@ -77,19 +77,6 @@ OBJ_GETTER(Kotlin_Interop_CreateKStringFromNSString, NSString* str) { RETURN_OBJ(result->obj()); } -OBJ_GETTER(Kotlin_Interop_ObjCToString, id ptr) { - RETURN_RESULT_OF(Kotlin_Interop_CreateKStringFromNSString, ptr.description); -} - -KInt Kotlin_Interop_ObjCHashCode(id ptr) { - uint64_t hash = ptr.hash; - return (KInt)(hash ^ (hash >> 32)); -} - -KBoolean Kotlin_Interop_ObjCEquals(id ptr, id otherPtr) { - return [ptr isEqual:otherPtr]; -} - // Note: this body is used for init methods with signatures differing from this; // it is correct on arm64 and x86_64, because the body uses only the first two arguments which are fixed, // and returns pointers. @@ -223,21 +210,6 @@ OBJ_GETTER(Kotlin_Interop_CreateKStringFromNSString, void* str) { RETURN_OBJ(nullptr); } -OBJ_GETTER(Kotlin_Interop_ObjCToString, KNativePtr ptr) { - RuntimeAssert(false, "Objective-C interop is disabled"); - RETURN_OBJ(nullptr); -} - -KInt Kotlin_Interop_ObjCHashCode(KNativePtr ptr) { - RuntimeAssert(false, "Objective-C interop is disabled"); - return 0; -} - -KBoolean Kotlin_Interop_ObjCEquals(KNativePtr ptr, KNativePtr otherPtr) { - RuntimeAssert(false, "Objective-C interop is disabled"); - return 0; -} - void* Kotlin_Interop_createKotlinObjectHolder(KRef any) { RuntimeAssert(false, "Objective-C interop is disabled"); return nullptr;