Issue #28768: Fix implicit declaration of function _setmode. Patch by Masayuki Yamamoto
diff --git a/Modules/main.c b/Modules/main.c
index 44217c6..73e87e0 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -10,6 +10,9 @@
 #endif
 
 #if defined(MS_WINDOWS) || defined(__CYGWIN__)
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
 #ifdef HAVE_FCNTL_H
 #include <fcntl.h>
 #endif