Skip to content
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 c_char vs u8 errors in the linux_raw backend. #971

Merged
merged 2 commits into from
Dec 9, 2023

Conversation

sunfishcode
Copy link
Member

Fix the linux_raw backend to handle the case where linux-raw-sys defines c_char as i8.

linux-raw-sys used to always define c_char as u8 because it usually isn't important to match the platform char type, but that makes it inconvenient to work with Rust's CStr/CString types which use c_char, so linux-raw-sys has started defining c_char as i8 on platforms which define it that way.

Fix the linux_raw backend to handle the case where linux-raw-sys defines
`c_char` as `i8`.

linux-raw-sys used to always define `c_char` as `u8` because it usually
isn't important to match the platform `char` type, but that makes it
inconvenient to work with Rust's `CStr`/`CString` types which use `c_char`,
so linux-raw-sys has started defining `c_char` as `i8` on platforms
which define it that way.
@sunfishcode sunfishcode merged commit 3758947 into main Dec 9, 2023
44 checks passed
@sunfishcode sunfishcode deleted the sunfishcode/char branch December 9, 2023 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant