how to correctly call the function: ```@kotlinx.c...
# ios
m
how to correctly call the function:
Copy code
@kotlinx.cinterop.internal.CCall public external fun SCNetworkReachabilityGetFlags(target: platform.SystemConfiguration.SCNetworkReachabilityRef? /* = kotlinx.cinterop.CPointer<cnames.structs.__SCNetworkReachability>? */, flags: kotlinx.cinterop.CValuesRef<platform.SystemConfiguration.SCNetworkReachabilityFlagsVar /* = kotlinx.cinterop.UIntVarOf<kotlin.UInt> */>?): kotlin.Boolean { /* compiled code */ }
to receive the
kSCNetworkReachabilityFlags…
correctly? in Swift, we can make the call:
Copy code
var flags: SCNetworkReachabilityFlags = []
if !SCNetworkReachabilityGetFlags(defaultRouteReachability, &flags) {
    return false
}
And receive the flags in an array style…. In Kotlin Native, I am doing:
Copy code
// val flags = allocArray<SCNetworkReachabilityFlagsVar>(10) // -> this was my first attempt, they are 10 possible flags!
val flags = alloc<SCNetworkReachabilityFlagsVar>()

if (!SCNetworkReachabilityGetFlags(reachabilityRef, flags.ptr)) return false
the problem is I am receiving all the flag “summed” (they are
kotlin.UInt
), and not split in an array, like in Swift.