Sean1708 / rusty-cheddar

A Rust crate for automatically generating C header files from Rust source file.
http://sean1708.github.io/rusty-cheddar/
191 stars 25 forks source link

Handle more conversions between Rust types and C types. #11

Closed Sean1708 closed 8 years ago

Sean1708 commented 8 years ago
Sean1708 commented 8 years ago

zsiciarz/rust-ffi-stringtools might come in handy.

Sean1708 commented 8 years ago

Also this.

Sean1708 commented 8 years ago

Do we force the programmers to use pointers or do we do some magic behind the scenes with references?

We can't do anything behind the scenes now that we use a drop-in so error on references.

How do we handle strings?

Error, note that you should be using *u8 or *mut u8.

Sean1708 commented 8 years ago

52a98fc170836b3be00a7b2b1faf4ab5a9efa3bb means that the only thing left is to warn/error on incompatible type.

The best thing to do would be to warn/error on types which aren't pointers, fn pointers, or paths and warn/error on non-libc paths which have multiple components.