diff -rupN Python-2.7.14/Modules/gdbmmodule.c Python-2.7.14-new/Modules/gdbmmodule.c
--- Python-2.7.14/Modules/gdbmmodule.c 2017-09-16 19:38:35.000000000 +0200
+++ Python-2.7.14-new/Modules/gdbmmodule.c 2017-10-31 18:36:42.865180430 +0100
@@ -11,7 +11,7 @@
#include <fcntl.h>
#include "gdbm.h"
-#if defined(WIN32) && !defined(__CYGWIN__)
+#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__)
#include "gdbmerrno.h"
extern const char * gdbm_strerror(gdbm_error);
#endif