Are there platform types in Kotlin/Native?
# kotlin-native
m
Are there platform types in Kotlin/Native?
t
What do you mean? There are a lot posix stuff in K/N for example
👍 1
n
As an example if Linux is being targeted (x64, ARMv7, MIPS) then its platform types (based on C types - https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.ref.dev.doc/q104610_.htm ; https://ufal.mff.cuni.cz/~jernej/2018/docs/predavanja10.pdf ) are available in Kotlin Native.
d
There was some issue somewhere of introducing platform types to cinterop, since by default all the pointers are nullable. Can't seem to find it right now.
m
Thanks 🙂
n
With Kotlin JVM all the Java platform types are nullable by default (unless the types are annotated as non nullable depending on the APIs used). Are there plans to allow specifying if a C API is nullable or not (eg with a function) with Kotlin Native?
s
specifying if a C API is nullable or not (eg with a function)
What do you mean?
d
The equivalent of java's
@NonNull
and
@Nullable
annotations for C.
👌 1
n
Also being able to do something similar in a "def" file (on API signature level with some functions in a C library).
s
I believe this is possible, but we don’t have any specific plans for this currently.
🆗 1