-
Notifications
You must be signed in to change notification settings - Fork 707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support --use-core and --ctypes-prefix #218
Conversation
@@ -0,0 +1,5 @@ | |||
// bindgen-flags: --ctypes-prefix "libc" --use-core --raw-line "#![no_std]" --raw-line "mod libc { pub type c_int = i32; pub enum c_void {} }" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
poor man's libc :)
@bors-servo delegate=fitzgen |
✌️ @fitzgen can now approve this pull request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but one comment below.
@@ -0,0 +1,6 @@ | |||
// bindgen-flags: --use-core --raw-line "extern crate core;" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't --use-core
imply extern crate core;
in the bindings? Shouldn't we automatically insert the extern crate definition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, at least not completely automatically I guess.
It's not uncommon doing include!("path/to/bindings.rs")
, in which case it's unnecessary. In general it's completely unnecessary as long as the bindings aren't the crate root, so I went the easy/safe way. if it's harmless we can do it in a followup, in which case is straight-forward to do.
Wow, that was fast. Thank you! |
@bors-servo r=fitzgen |
📌 Commit 6611276 has been approved by |
Support --use-core and --ctypes-prefix As requested in https://github.com/Yamakaky/rust-bindgen/issues/400#issuecomment-258632805. r? @fitzgen
☀️ Test successful - status-travis |
Doesn't seem to output
|
As requested in https://github.com/Yamakaky/rust-bindgen/issues/400#issuecomment-258632805.
r? @fitzgen