cygwin #define bug?


In cygwin, _types.h file has the following define:

#define __need_wint_t
#include <stddef.h>

But in stddef.h, __need_wint_t is not defined. I'm sure stddef.h is
included. So the wint_t type is not defined. Why could this happen?

Probably related to PR7571 / this thread:

The gist of it is stddef.h is being included before _types.h, the
reinclude is caught by the header guard, and the __need_wint_t is ignored.
Does that match your situation?

Last I saw, the most correct proposed solution was moving the __need*
specifics outside the header guard, but of course that loses the
include-once optimization.

Yes, I met exactly the same problem.