From a4af67a67ab94ba09525246b9d4de3cd3927d6dc Mon Sep 17 00:00:00 2001 From: Jorge Antonio Diaz-Benito Soriano Date: Fri, 29 Mar 2024 18:45:43 +0100 Subject: [PATCH 1/2] Replace #include with #import --- .../src/nativeInterop/cinterop/NetworkFrameworkWorkaround.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/src/nativeInterop/cinterop/NetworkFrameworkWorkaround.def b/library/src/nativeInterop/cinterop/NetworkFrameworkWorkaround.def index f2e1de5c..a7d1f5f7 100644 --- a/library/src/nativeInterop/cinterop/NetworkFrameworkWorkaround.def +++ b/library/src/nativeInterop/cinterop/NetworkFrameworkWorkaround.def @@ -3,7 +3,7 @@ language = Objective-C --- -#include +#import #import // https://stackoverflow.com/a/63050804 From 783665d7cb2cec8c1fd97a7e85473fb9892b8f9a Mon Sep 17 00:00:00 2001 From: Jorge Antonio Diaz-Benito Soriano Date: Tue, 2 Apr 2024 12:55:33 +0200 Subject: [PATCH 2/2] Renames --- .../tidal/networktime/internal/NTPUDPSocketOperations.kt | 8 ++++---- .../nativeInterop/cinterop/NetworkFrameworkWorkaround.def | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/library/src/appleMain/kotlin/com/tidal/networktime/internal/NTPUDPSocketOperations.kt b/library/src/appleMain/kotlin/com/tidal/networktime/internal/NTPUDPSocketOperations.kt index e58d8e1e..7c6fd712 100644 --- a/library/src/appleMain/kotlin/com/tidal/networktime/internal/NTPUDPSocketOperations.kt +++ b/library/src/appleMain/kotlin/com/tidal/networktime/internal/NTPUDPSocketOperations.kt @@ -1,7 +1,7 @@ package com.tidal.networktime.internal -import com.tidal.networktime.internal.network_framework_workaround.nw_connection_send_with_default_context -import com.tidal.networktime.internal.network_framework_workaround.nw_parameters_create_secure_udp_workaround +import com.tidal.networktime.internal.network_framework_workaround.nw_connection_send_default_context +import com.tidal.networktime.internal.network_framework_workaround.nw_parameters_create_secure_udp_disable_protocol import kotlinx.cinterop.ExperimentalForeignApi import kotlinx.cinterop.addressOf import kotlinx.cinterop.convert @@ -38,7 +38,7 @@ internal actual class NTPUDPSocketOperations { actual suspend fun prepare(address: String, portNumber: Int, connectTimeout: Duration) { println("BEFORE CREATESECUREUDP") - val parameters = nw_parameters_create_secure_udp_workaround() + val parameters = nw_parameters_create_secure_udp_disable_protocol() println("BEFORE CREATEHOST") println("Endpoint is $address/$portNumber") val endpoint = nw_endpoint_create_host(address, portNumber.toString()) @@ -76,7 +76,7 @@ internal actual class NTPUDPSocketOperations { ) } println("BEFORE SEND") - nw_connection_send_with_default_context( + nw_connection_send_default_context( connection, data, true, diff --git a/library/src/nativeInterop/cinterop/NetworkFrameworkWorkaround.def b/library/src/nativeInterop/cinterop/NetworkFrameworkWorkaround.def index a7d1f5f7..6299952b 100644 --- a/library/src/nativeInterop/cinterop/NetworkFrameworkWorkaround.def +++ b/library/src/nativeInterop/cinterop/NetworkFrameworkWorkaround.def @@ -7,7 +7,7 @@ language = Objective-C #import // https://stackoverflow.com/a/63050804 -NW_RETURNS_RETAINED nw_parameters_t nw_parameters_create_secure_udp_workaround() { +NW_RETURNS_RETAINED nw_parameters_t nw_parameters_create_secure_udp_disable_protocol() { return nw_parameters_create_secure_udp( NW_PARAMETERS_DISABLE_PROTOCOL, NW_PARAMETERS_DEFAULT_CONFIGURATION @@ -15,7 +15,7 @@ NW_RETURNS_RETAINED nw_parameters_t nw_parameters_create_secure_udp_workaround() } // https://youtrack.jetbrains.com/issue/KT-62102/ -void nw_connection_send_with_default_context( +void nw_connection_send_default_context( nw_connection_t connection, _Nullable dispatch_data_t content, bool is_complete,