Skip to content

Commit

Permalink
fix: new kotlin version opt-ints for native
Browse files Browse the repository at this point in the history
  • Loading branch information
y9san9 committed Nov 7, 2023
1 parent bd11b38 commit 2d181a7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions io/src/iosMain/kotlin/app/meetacy/sdk/io/FileHandleInput.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:OptIn(ExperimentalForeignApi::class)

package app.meetacy.sdk.io

import app.meetacy.sdk.io.bytes.ByteArrayView
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions io/src/iosMain/kotlin/app/meetacy/sdk/io/FileHandleOutput.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:OptIn(ExperimentalForeignApi::class)

package app.meetacy.sdk.io

import app.meetacy.sdk.io.bytes.ByteArrayView
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions io/src/iosMain/kotlin/app/meetacy/sdk/io/NSError.kt
Original file line number Diff line number Diff line change
@@ -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 <T> MemScope.runCatching(block: (ObjCObjectVar<NSError?>) -> T): IosResult<T> {
val error = alloc<ObjCObjectVar<NSError?>>()
Expand Down

0 comments on commit 2d181a7

Please sign in to comment.