gnzlbg / ctest

Automatic testing of FFI bindings for Rust

Home Page:https://docs.rs/ctest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

typedef for a struct is missing the struct keyword

elichai opened this issue · comments

Him
if you have rust code like:

type flock64 = flock;
struct flock {...}

The C code will use flock64 instead of struct flock64.
Is that something I should handle with type_name myself?

CC rust-lang/libc#1561

This is working as intended. In Rust, flock64 is a type alias, not a struct, and that's how it gets expanded to C. If you want it to expand to a struct, either define a Rust struct, or use type_name to configure the behavior.