diff -rupN Python-2.7.13/Modules/gdbmmodule.c Python-2.7.13-new/Modules/gdbmmodule.c
--- Python-2.7.13/Modules/gdbmmodule.c 2016-12-17 21:05:07.000000000 +0100
+++ Python-2.7.13-new/Modules/gdbmmodule.c 2017-01-21 01:46:15.166515096 +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