From 2d181a7ee01bc39070c6141642b928c8ac43d0c2 Mon Sep 17 00:00:00 2001 From: Alex Sokol / y9san9 Date: Tue, 7 Nov 2023 12:36:01 +0300 Subject: [PATCH] fix: new kotlin version opt-ints for native --- io/src/iosMain/kotlin/app/meetacy/sdk/io/FileHandleInput.kt | 3 +++ io/src/iosMain/kotlin/app/meetacy/sdk/io/FileHandleOutput.kt | 3 +++ io/src/iosMain/kotlin/app/meetacy/sdk/io/NSError.kt | 3 +++ 3 files changed, 9 insertions(+) diff --git a/io/src/iosMain/kotlin/app/meetacy/sdk/io/FileHandleInput.kt b/io/src/iosMain/kotlin/app/meetacy/sdk/io/FileHandleInput.kt index aa08b167..d530e4b0 100644 --- a/io/src/iosMain/kotlin/app/meetacy/sdk/io/FileHandleInput.kt +++ b/io/src/iosMain/kotlin/app/meetacy/sdk/io/FileHandleInput.kt @@ -1,3 +1,5 @@ +@file:OptIn(ExperimentalForeignApi::class) + package app.meetacy.sdk.io import app.meetacy.sdk.io.bytes.ByteArrayView @@ -13,6 +15,7 @@ import platform.Foundation.closeFile import platform.Foundation.fileHandleForReadingFromURL import platform.posix.memcpy import kotlin.coroutines.CoroutineContext +import kotlinx.cinterop.ExperimentalForeignApi public fun NSURL.asMeetacyInputSource( context: CoroutineContext = Dispatchers.Default diff --git a/io/src/iosMain/kotlin/app/meetacy/sdk/io/FileHandleOutput.kt b/io/src/iosMain/kotlin/app/meetacy/sdk/io/FileHandleOutput.kt index a6930c50..74aa130a 100644 --- a/io/src/iosMain/kotlin/app/meetacy/sdk/io/FileHandleOutput.kt +++ b/io/src/iosMain/kotlin/app/meetacy/sdk/io/FileHandleOutput.kt @@ -1,3 +1,5 @@ +@file:OptIn(ExperimentalForeignApi::class) + package app.meetacy.sdk.io import app.meetacy.sdk.io.bytes.ByteArrayView @@ -9,6 +11,7 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import platform.Foundation.* import kotlin.coroutines.CoroutineContext +import kotlinx.cinterop.ExperimentalForeignApi public fun NSURL.asMeetacyOutputSource( context: CoroutineContext = Dispatchers.Default diff --git a/io/src/iosMain/kotlin/app/meetacy/sdk/io/NSError.kt b/io/src/iosMain/kotlin/app/meetacy/sdk/io/NSError.kt index eefb12fd..d2031eb5 100644 --- a/io/src/iosMain/kotlin/app/meetacy/sdk/io/NSError.kt +++ b/io/src/iosMain/kotlin/app/meetacy/sdk/io/NSError.kt @@ -1,7 +1,10 @@ +@file:OptIn(ExperimentalForeignApi::class) + package app.meetacy.sdk.io import kotlinx.cinterop.* import platform.Foundation.NSError +import kotlinx.cinterop.ExperimentalForeignApi public inline fun MemScope.runCatching(block: (ObjCObjectVar) -> T): IosResult { val error = alloc>()