diff --git a/glib/gwin32.c b/glib/gwin32.c
index ce462bb..481924c 100644
--- a/glib/gwin32.c
+++ b/glib/gwin32.c
@@ -59,6 +59,8 @@
 #ifdef _MSC_VER
 #pragma comment (lib, "ntoskrnl.lib")
 #endif
+#elif defined __MINGW32__
+#include <ntdef.h>
 #else
 #include <winternl.h>
 #endif
