Use libc::strerror_r instead of our own definition#85
Merged
sunfishcode merged 1 commit intolambda-fairy:mainfrom Nov 1, 2023
Merged
Use libc::strerror_r instead of our own definition#85sunfishcode merged 1 commit intolambda-fairy:mainfrom
sunfishcode merged 1 commit intolambda-fairy:mainfrom
Conversation
Contributor
Author
FYI, the following is a script I used to check this. #!/bin/bash
targets=(
# src/windows.rs
x86_64-pc-windows-msvc
x86_64-pc-windows-gnu
# src/wasi.rs
wasm32-wasi
# src/unix.rs
aarch64-apple-ios
i686-unknown-hurd-gnu
powerpc64-ibm-aix
riscv32imc-esp-espidf
x86_64-apple-darwin
x86_64-linux-android
x86_64-pc-nto-qnx710
x86_64-pc-solaris
x86_64-unknown-dragonfly
x86_64-unknown-freebsd
x86_64-unknown-haiku
x86_64-unknown-hermit
x86_64-unknown-illumos
x86_64-unknown-linux-gnu
x86_64-unknown-linux-musl
x86_64-unknown-netbsd
x86_64-unknown-openbsd
x86_64-unknown-redox
)
# Use -Z build-std for tier 3 targets.
rustup component add rust-src
for target in "${targets[@]}"; do
if rustup target add "${target}" &>/dev/null; then
cargo build --no-default-features --target "${target}"
else
cargo build --no-default-features -Z build-std=core --target "${target}"
fi
done |
Collaborator
|
It does appear that the libc crate version has the needed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We already depend on libc to use strlen, and libc provides strerror_r for all unix/wasi platforms we support.
(As for errno_location, it seems that libc does not provide a corresponding one for some platforms yet.)