wint_t
type is set inside wchar.h
via stddef.h
, using the fact that __WINT_TYPE__
is already defined in the compiler by default. So to change
typedef unsigned int wint_t;
into
typedef wchar_t wint_t;
we may use the following code in the beginning of wchar.h
#undef __WINT_TYPE__
#define __WINT_TYPE__ wchar_t
#define WEOF (-1)
But this comment suggests that doing this "breaks compatibility for C++ mangling".
You can't change existing definitions of typedefs such as wint_t without breaking ABI compatibility (even when you have the same size and signedness and so are ABI-compatible for C, changing the underlying type breaks compatibility for C++ mangling).
So, why exactly this typedef cannot be changed and what is "compatibility for C++ mangling"?
See also this question How to change wchar.h to make wchar_t the same type as wint_t?