Closed ChrisDenton closed 2 months ago
@ChrisDenton getenv
can be replaced with GetEnvironmentVariableA
- would you be ok with a hand-coded binding, or would you want windows-rs
pulled in so that the binding can be generated?
While this feature isn't enabled by our std builds, it could be, So a hand-coded binding would be better.
While this feature isn't enabled by our std builds, it could be, So a hand-coded binding would be better.
Done: #1571
I'm trying to reduce std's dependency on libc when it isn't actually needed.
Currently std_detect depends on libc for these features: https://github.com/rust-lang/stdarch/blob/9814fb0ec86e12ca68a3999660cee9617e232651/crates/std_detect/Cargo.toml#L37-L39
However, for windows-msvc, the only feature actually using libc in std_detect is
std_detect_env_override
https://github.com/rust-lang/stdarch/blob/9814fb0ec86e12ca68a3999660cee9617e232651/crates/std_detect/src/detect/cache.rs#L120-L137The easier way to address this issue is to make it so the on windows-msvc targets, libc is only used for this feature. The harder way is to use the Windows native equivalent of
libc::getenv
.