csbindgen icon indicating copy to clipboard operation
csbindgen copied to clipboard

fix handling of MaybeUninit

Open mhama opened this issue 9 months ago • 0 comments

With current csbindgen, type MaybeUninit<some_type> will be converted to MaybeUninit on the binding code. This behaviour makes the output code unusable because the information about the internal type is missing.

I modified the parser code to just ignore MaybeUninit<> and just use the internal type. I'm not expert of Rust but I think it is ok, as MaybeUninit is for indicating that the memory is not initialized, I guess it can be ignored on binding code.

For reference, here's one of the code which uses MaybeUninit<>. https://github.com/eclipse-zenoh/zenoh-c/blob/1010f5b6544f476a34046420a7a561e754ce6cbd/src/session.rs#L82-L86

mhama avatar Mar 30 '25 16:03 mhama