greyblake / whatlang-ffi

C bindings for whatlang Rust library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Types without #[repr()] in external functions

Dr-Emann opened this issue · comments

Functions take Lang and Script which are not annotated with a #[repr()] annotation in whatlang. C-Like Enums without #[repr()] are currently represented by the smallest integer size which can hold all values, but this is not guaranteed.

You're right.

I just post it here for myself: https://doc.rust-lang.org/nomicon/other-reprs.html

. Any type you expect to pass through an FFI boundary should have repr(C), as C is the lingua-franca of the programming world.