-
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
Fix feature dependency #17
Fix feature dependency #17
Conversation
Interesting. What do you thing @thejpster ? |
Wut??? Am I missing something here? |
Could you update the clippy version to 1.75.0 here in the .github/workflows/build.yml? tinyrlibc/.github/workflows/build.yml Line 106 in e9a3798
|
Instead of adding |
I guess I need to get rid of the errno placeholder. Sorry for the implementation being all over the place; This was for my own project, and I thought it would be great if it merges upstream.
This was why r_xxx funcs were set as pub(crate).
I am not aware of that feature, could you please leave a link or an example of its use? Thanks for your feedback! |
This build warning is also shown at the main branch too. |
Things are all cleaned up. What do you think @jonathanpallant ? |
Everything should be okay, except the fact that disabling feature |
Looks good at first glance - I'll give it a second pass when I can. Does defining X as X in the build script actually do anything? |
The #[cfg_attr(not(feature = "itoa"), export_name = "tinyrlibc_itoa")]
#[cfg_attr(feature = "itoa", no_mangle)]
pub unsafe extern "C" fn itoa(i: i64, s: *mut CChar, s_len: usize, radix: u8) -> i32 { The same is applied to |
Yes but is it necessary to define a macro X (e.g. "iota") which has the value X (e.g. "iota"). You could just not define it and you'd get the same result, right? With less code? Maybe I'm missing something. |
I'm not sure the .clone() calls are required either. |
Yeah, you're right! Changes are pushed. |
I think we're good to go. Just a quick question as I'm on my phone - did the errno stuff stay in or get removed? Because there's a flag for it, but also there's todos saying they should set errno. Sorry, I couldn't find a search button. |
Oops, fixed. I blindly thought rust had some kind of unused feature warning. |
I'll merge this tomorrow. Note to self - squash it. Thank you for your PR! It is much appreciated. |
0fe817f
into
rust-embedded-community:master
When adding functions like
strtol
,strtoll
,strtoul
,strtoull
, andisspace
, the functions can share a lot of helper functions. This makes feature gating each function hard since the dependency of each feature is intertwined with each other .I added changes to leave the internal implementation of a
func
asr_func
that ispub(crate)
regardless of the feature gate, and then feature gated the actualfunc
.Also, type definitions are moved to a separate file:
ctype.rs
Added implementations of
strtoll
,stroull
,strtoimax
,strtoumax
,isspace
,isdigit
,isalpha
,isupper