提交 0b6b43ed 编写于 作者: R Rich Felker

use __WCHAR_TYPE__ on i386 if it is defined

unfortunately traditional i386 practice was to use "long" rather than
"int" for wchar_t, despite the latter being much more natural and
logical. we followed this practice, but it seems some compilers (clang
and maybe certain gcc builds or others too..?) have switched to using
int, resulting in spurious pointer type mismatches when L"..." wide
strings are used. the best solution I could find is to use the
compiler's definition of wchar_t if it exists, and otherwise fallback
to the traditional definition.

there's no point in duplicating this approach on 64-bit archs, as
their only 32-bit type is int.
上级 86f8c72b
...@@ -26,7 +26,11 @@ TYPEDEF __builtin_va_list va_list; ...@@ -26,7 +26,11 @@ TYPEDEF __builtin_va_list va_list;
TYPEDEF struct __va_list * va_list; TYPEDEF struct __va_list * va_list;
#endif #endif
#ifdef __WCHAR_TYPE__
TYPEDEF __WCHAR_TYPE__ wchar_t;
#else
TYPEDEF long wchar_t; TYPEDEF long wchar_t;
#endif
TYPEDEF long wint_t; TYPEDEF long wint_t;
TYPEDEF long wctrans_t; TYPEDEF long wctrans_t;
TYPEDEF long wctype_t; TYPEDEF long wctype_t;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册