A typewint_tinstalls internally wchar.hthrough stddef.h, using the fact that it is __WINT_TYPE__already defined in the compiler by default. So, to change
typedef unsigned int wint_t;
at
typedef wchar_t wint_t;
we can use the following code at the beginning wchar.h
#undef __WINT_TYPE__
#define __WINT_TYPE__ wchar_t
#define WEOF (-1)
But this comment suggests that doing this "violates compatibility for C ++ mangling."
You cannot modify existing typedefs, such as wint_t, without breaking compatibility with ABI (even if you have the same size and subscription and, therefore, are ABI-compatible for C, changing the base type breaks compatibility for C ++ mangling).
So, why exactly this typedef cannot be changed and what is "compatibility for C ++ mangling"?
. wchar.h, wchar_t , wint_t?