-
Notifications
You must be signed in to change notification settings - Fork 13
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
no_std support (closes #11) #12
Conversation
src/hide.rs
Outdated
@@ -63,7 +63,7 @@ mod nightly { | |||
} | |||
|
|||
// When a C compiler is available, a dummy C function can be used. | |||
#[cfg(not(feature = "no_cc"))] | |||
#[cfg(all(not(feature = "no_cc"), feature = "std"))] | |||
mod cc { | |||
use std::os::raw::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.
Wow, using std::os::raw::c_void
from no_std
is one deep rabbit hole. Some decent background in this thread:
https://internals.rust-lang.org/t/solve-std-os-raw-c-void/3268/16
I guess this is the path forward, but work has not yet begun:
An interim option is to use libc::c_void
from the libc
crate, but no_std
users are presently stuck on nightly anyway for a number of reasons, so simply using the nightly features seems to me like the best solution for no_std
users for now.
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.
On second thought, the std
feature I added exists exclusively to support this. It'd be nice to not have a std
feature at all.
An interim solution would be to change the no_cc
feature to be a default cc
feature (features are supposed to be additive anyway), and have an optional dependency on libc
pulled in when the cc
feature is enabled.
f012580
to
34c7cd1
Compare
Well, I redid this as a breaking change (see f012580 for an attempt to do it mostly backwards compatibly). I changed the https://internals.rust-lang.org/t/solve-std-os-raw-c-void/3268/16 Apparently this is the path forward: |
8ac1828
to
4341586
Compare
You missed the documentation comments and the readme, which also reference While |
Changes references from std:: to core:: where applicable, ensuring the crate builds in no_std environments.
Okay, I changed |
Changes references from std:: to core:: where applicable, ensuring the crate builds in no_std environments.