Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions library/core/src/ffi/primitives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ mod c_char_definition {
// These are the targets on which c_char is unsigned. Usually the
// signedness is the same for all target_os values on a given architecture
// but there are some exceptions (see isSignedCharDefault() in clang).
//
// aarch64:
// Section 10 "Arm C and C++ language mappings" in Procedure Call Standard for the Arm®
// 64-bit Architecture (AArch64) says C/C++ char is unsigned byte.
Expand Down Expand Up @@ -97,14 +96,19 @@ mod c_char_definition {
// are promoted to int as if from type signed char by default, unless the /J compilation
// option is used."
// https://learn.microsoft.com/en-us/cpp/cpp/fundamental-types-cpp?view=msvc-170#character-types
// Vita:
// Chars are signed by default on the Vita, and VITASDK follows that convention.
// https://github.com/vitasdk/buildscripts/blob/09c533b771591ecde88864b6acad28ffb688dbd4/patches/gcc/0001-gcc-10.patch#L33-L34
//
// L4Re:
// The kernel builds with -funsigned-char on all targets (but useserspace follows the
// The kernel builds with -funsigned-char on all targets (but userspace follows the
// architecture defaults). As we only have a target for userspace apps so there are no
// special cases for L4Re below.
// https://github.com/rust-lang/rust/pull/132975#issuecomment-2484645240
if #[cfg(all(
not(windows),
not(target_vendor = "apple"),
not(target_os = "vita"),
any(
target_arch = "aarch64",
target_arch = "arm",
Expand Down
Loading