In current version of mingw wint_t type is defined only in stddef.h header, which is actually compiler-specific header and is placed in /lib/gcc/mingw32/<version>/include directory.
However, C standard says that wint_t type should be defined in wchar.h and wctype.h headers, and there is now such requirements for stddef.h.
In gnu c library, wchar.h header defines wint_t if it is not defined in stddef.h. I think that mingw should do the same.
This problem occurs when trying to use clang ftont-end with mingw headers. clang does not define wint_t type in stddef.h header.
Also, wide character classification functions (like iswalnum, iswdigit) are defined in ctype.h header (which includes stddef.h for wint_t type). I belive they should not be defined here.
The stddef.h file is in essence the same as MSVC's crtdefs.h. This issue belongs to CLANG which needs to define wint_t in friends their. wchar.h and others then include it to define wint_t.