-
Notifications
You must be signed in to change notification settings - Fork 239
Replace util_libc and sanitizer modules with impl_utils macro
#763
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
base: master
Are you sure you want to change the base?
Conversation
util_libc with impl_utils macroutil_libc and sanitizer with impl_utils macro
util_libc and sanitizer with impl_utils macroutil_libc and sanitizer modules with impl_utils macro
| (get_errno) => { | ||
| cfg_if! { | ||
| if #[cfg(any(target_os = "netbsd", target_os = "openbsd", target_os = "android", target_os = "cygwin"))] { | ||
| use libc::__errno as errno_location; |
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.
Technically, we could move these imports into backends, but I think it will result in a more convoluted and harder to review code.
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.
personal opinion: that would be better
tamird
left a comment
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.
👍
| (get_errno) => { | ||
| cfg_if! { | ||
| if #[cfg(any(target_os = "netbsd", target_os = "openbsd", target_os = "android", target_os = "cygwin"))] { | ||
| use libc::__errno as errno_location; |
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.
personal opinion: that would be better
|
What is the purpose of this change? |
|
It's my take on #760 which removes reliance on the uncommon Though one change which I think we should certainly do is to move the |
It is an implementation detail of some backends so I think it is fine there. IMO not worth the churn. But, IDC much. |
It is an ugly thing but I don't think it's worth introducing additional complexity. In other projects, I tend to use I don't think the macro is an improvement. |
That pattern wouldn't work here because the module compiles only on certain targets. This is why I think #763 (comment) is an improvement; it would make that more clear. |
It does work just fine; just the |
Based on #760