path: root/arch/x86_64/bits/
diff options
authorRich Felker <>2013-03-04 19:22:14 -0500
committerRich Felker <>2013-03-04 19:22:14 -0500
commitda1442c9a8c58f8ad85a1bd96007f60bc372d157 (patch)
tree91f94f4aca74c5b625723ba62ef488c0b9fa9982 /arch/x86_64/bits/
parent8c741783fc96d559cfe79301c924c217b2905c0c (diff)
fix types for wctype_t and wctrans_t
wctype_t was incorrectly "int" rather than "long" on x86_64. not only is this an ABI incompatibility; it's also a major design flaw if we ever wanted wctype_t to be implemented as a pointer, which would be necessary if locales support custom character classes, since int is too small to store a converted pointer. this commit fixes wctype_t to be unsigned long on all archs, matching the LSB ABI; this change does not matter for C code, but for C++ it affects mangling. the same issue applied to wctrans_t. glibc/LSB defines this type as const __int32_t *, but since no such definition is visible, I've just expanded the definition, int, everywhere. it would be nice if these types (which don't vary by arch) could be in wctype.h, but the OB XSI requirement in POSIX that wchar.h expose some types and functions from wctype.h precludes doing so. glibc works around this with some hideous hacks, but trying to duplicate that would go against the intent of musl's headers.
Diffstat (limited to 'arch/x86_64/bits/')
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86_64/bits/ b/arch/x86_64/bits/
index 083ea230..bc9a3cc0 100755
--- a/arch/x86_64/bits/
+++ b/arch/x86_64/bits/
@@ -25,8 +25,8 @@ TYPEDEF __builtin_va_list va_list;
TYPEDEF int wchar_t;
TYPEDEF int wint_t;
-TYPEDEF int wctrans_t;
-TYPEDEF int wctype_t;
+TYPEDEF const int * wctrans_t;
+TYPEDEF unsigned long wctype_t;
TYPEDEF signed char int8_t;
TYPEDEF short int16_t;