What is the non static variant to use local variab...
# kotlin-native
h
What is the non static variant to use local variables for
staticCFunction
? expected type:
kotlinx.cinterop.CPointer<kotlinx.cinterop.CFunction<(...) -> kotlin.Unit>>
I want to use it with this code:
Copy code
fun caller() {
    var counter = 0
    val s: () -> Unit = { 
        counter++
    }
    consumer(staticCFunction(s)) // does not work, because I use the local variable `counter`
}
fun consumer(callback:  kotlinx.cinterop.CPointer<kotlinx.cinterop.CFunction<(...) -> kotlin.Unit>>) { ... }