diff --git a/src/include/port/win32.h b/src/include/port/win32.h
index 5d41fd3..c5ba5e0 100644
--- a/src/include/port/win32.h
+++ b/src/include/port/win32.h
@@ -78,8 +78,8 @@
 #define PGDLLIMPORT __declspec (dllimport)
 #endif
 
-#ifdef _MSC_VER
-#define PGDLLEXPORT __declspec (dllexport)
+#if defined _MSC_VER || defined __MINGW64__
+#define PGDLLEXPORT __declspec (dllexport) 
 #else
 #define PGDLLEXPORT
 #endif
