I'm using cinterop to generate bindings the xlib l...
# kotlin-native
z
I'm using cinterop to generate bindings the xlib library and I'm wondering if theres some way to define conversions for a specific type. Like I want to somehow make it use kotlin primitive booleans for the Bool macro in the header file
l
I don’t know that there’s a way to automatically convert, but I generally write a Boolean.toBool(): Int and a Int.toKBoolean(): Boolean and call these.
Boolean.toBool() = if(this) 1 else 0 Int.toKBoolean() = this != 0