musl/arch
Rich Felker 1f0e9f9cc2 honor __WCHAR_TYPE__ on archs with legacy long definition of wchar_t
historically, a number of 32-bit archs used long rather than int for
wchar_t, for no good reason. GCC still uses the historical types, but
clang replaced them all with int, and it seems PCC uses int too.
mismatching the compiler's type for wchar_t is not an option due to
wide string literals.

note that the mismatch does not affect C++ ABI since wchar_t is its
own builtin type/keyword in C++, distinct from both int and long, not
a typedef.

i386 already worked around this by honoring __WCHAR_TYPE__ if defined
by the compiler, and only using the official legacy ABI type if not.
add the same to the other affected archs.

it might make sense at some point to switch to using int as the
default if __WCHAR_TYPE__ is not defined, if the expectations is that
new compilers will treat int as the correct choice, but it's unlikely
that the case where __WCHAR_TYPE__ is undefined will ever be used
anyway. I actually wanted to move the definition of wchar_t to the
top-level shared alltypes.h.in, using __WCHAR_TYPE__ and falling back
to int if not defined, but that can't be done without assuming all
compilers define __WCHAR_TYPE__ thanks to some pathological archs
where the ABI has wchar_t as an unsigned type.
2019-09-08 17:33:48 -04:00
..
aarch64 remove gratuitously-different arch-specific bits/ipc.h files 2019-07-30 14:23:56 -04:00
arm move IPC_STAT definition to a new bits/ipcstat.h file 2019-08-02 00:08:23 -04:00
generic move IPC_STAT definition to a new bits/ipcstat.h file 2019-08-02 00:08:23 -04:00
i386 move IPC_STAT definition to a new bits/ipcstat.h file 2019-08-02 00:08:23 -04:00
m68k honor __WCHAR_TYPE__ on archs with legacy long definition of wchar_t 2019-09-08 17:33:48 -04:00
microblaze move IPC_STAT definition to a new bits/ipcstat.h file 2019-08-02 00:08:23 -04:00
mips move IPC_STAT definition to a new bits/ipcstat.h file 2019-08-02 00:08:23 -04:00
mips64 get/setsockopt: add fallback for new time64 SO_RCVTIMEO/SO_SNDTIMEO 2019-07-31 20:20:57 -04:00
mipsn32 move IPC_STAT definition to a new bits/ipcstat.h file 2019-08-02 00:08:23 -04:00
or1k move IPC_STAT definition to a new bits/ipcstat.h file 2019-08-02 00:08:23 -04:00
powerpc honor __WCHAR_TYPE__ on archs with legacy long definition of wchar_t 2019-09-08 17:33:48 -04:00
powerpc64 fix clash between sys/user.h and kernel ptrace.h on powerpc[64], sh 2019-08-19 00:32:11 -04:00
riscv64 re-add ELF gregs and fpregs types to riscv64 user.h 2019-08-13 22:05:38 -04:00
s390x remove gratuitously-different arch-specific bits/ipc.h files 2019-07-30 14:23:56 -04:00
sh honor __WCHAR_TYPE__ on archs with legacy long definition of wchar_t 2019-09-08 17:33:48 -04:00
x32 honor __WCHAR_TYPE__ on archs with legacy long definition of wchar_t 2019-09-08 17:33:48 -04:00
x86_64 remove arch-specific bits/ipc.h that are identical to generic 2019-07-30 14:23:56 -04:00