Skip to content

Commit 91a33a8

Browse files
authored
kn: upgrade crt dependencies (#135)
1 parent d3c8108 commit 91a33a8

File tree

13 files changed

+26
-19
lines changed

13 files changed

+26
-19
lines changed

aws-crt-kotlin/native/interop/crt.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ headers = aws/common/allocator.h \
3131
aws/checksums/crc.h
3232
headerFilter = aws/common/* aws/io/* aws/http/* aws/compression/* aws/auth/* aws/checksums/* aws/cal/*
3333

34-
linkerOpts.osx = -framework Security
35-
linkerOpts.ios = -framework Security
34+
linkerOpts.osx = -framework Security -framework Network
35+
linkerOpts.ios = -framework Security -framework Network
3636

3737
# included libs are linked automatically, adding linkerOpts like `-laws-c-common` causes
3838
# issues downstream as it will search for that library still.

aws-crt-kotlin/native/src/aws/sdk/kotlin/crt/io/EventLoopGroupNative.kt

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import aws.sdk.kotlin.crt.*
99
import aws.sdk.kotlin.crt.Allocator
1010
import aws.sdk.kotlin.crt.util.ShutdownChannel
1111
import aws.sdk.kotlin.crt.util.shutdownChannel
12+
import cnames.structs.aws_event_loop_group
1213
import kotlinx.cinterop.*
1314
import libcrt.*
1415

@@ -32,13 +33,19 @@ public actual class EventLoopGroup actual constructor(maxThreads: Int) :
3233
private val channelStableRef = StableRef.create(shutdownCompleteChannel)
3334

3435
init {
35-
val shutdownOpts = cValue<aws_shutdown_callback_options> {
36-
shutdown_callback_fn = staticCFunction(::onShutdownComplete)
37-
shutdown_callback_user_data = channelStableRef.asCPointer()
38-
}
36+
ptr = memScoped {
37+
val shutdownOpts = cValue<aws_shutdown_callback_options> {
38+
shutdown_callback_fn = staticCFunction(::onShutdownComplete)
39+
shutdown_callback_user_data = channelStableRef.asCPointer()
40+
}
41+
42+
val eventLoopGroupOpts = cValue<aws_event_loop_group_options> {
43+
shutdown_options = shutdownOpts.ptr
44+
}
3945

40-
ptr = checkNotNull(aws_event_loop_group_new_default(Allocator.Default, maxThreads.toUShort(), shutdownOpts)) {
41-
"aws_event_loop_group_new_default()"
46+
checkNotNull(aws_event_loop_group_new(Allocator.Default, eventLoopGroupOpts)) {
47+
"aws_event_loop_group_new()"
48+
}
4249
}
4350
}
4451

crt/aws-c-common

Submodule aws-c-common updated 56 files

crt/aws-c-io

Submodule aws-c-io updated 65 files

0 commit comments

Comments
 (0)