Skip to content

Fix c_char vs u8 errors in the linux_raw backend.#971

Merged
sunfishcode merged 2 commits intomainfrom
sunfishcode/char
Dec 9, 2023
Merged

Fix c_char vs u8 errors in the linux_raw backend.#971
sunfishcode merged 2 commits intomainfrom
sunfishcode/char

Conversation

@sunfishcode
Copy link
Copy Markdown
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
@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