Index: src/include/c.h
===================================================================
--- src/include/c.h	(head)
+++ src/include/c.h	(fixed)
@@ -788,6 +788,10 @@
 #define PGDLLIMPORT				/* no special DLL markers on most ports */
 #endif
 
+#ifndef PGMODULEEXPORT
+#define PGMODULEEXPORT			/* no special DLL markers on most ports */
+#endif
+
 /*
  * The following is used as the arg list for signal handlers.  Any ports
  * that take something other than an int argument should override this in
Index: src/include/fmgr.h
===================================================================
--- src/include/fmgr.h	(head)
+++ src/include/fmgr.h	(fixed)
@@ -328,7 +328,7 @@
  *	doesn't hurt to add PGDLLIMPORT in case they don't.
  */
 #define PG_FUNCTION_INFO_V1(funcname) \
-extern PGDLLIMPORT const Pg_finfo_record * CppConcat(pg_finfo_,funcname)(void); \
+extern PGMODULEEXPORT const Pg_finfo_record * CppConcat(pg_finfo_,funcname)(void); \
 const Pg_finfo_record * \
 CppConcat(pg_finfo_,funcname) (void) \
 { \
@@ -397,7 +397,7 @@
 #define PG_MAGIC_FUNCTION_NAME_STRING "Pg_magic_func"
 
 #define PG_MODULE_MAGIC \
-extern PGDLLIMPORT const Pg_magic_struct *PG_MAGIC_FUNCTION_NAME(void); \
+extern PGMODULEEXPORT const Pg_magic_struct *PG_MAGIC_FUNCTION_NAME(void); \
 const Pg_magic_struct * \
 PG_MAGIC_FUNCTION_NAME(void) \
 { \
Index: src/include/port/cygwin.h
===================================================================
--- src/include/port/cygwin.h	(head)
+++ src/include/port/cygwin.h	(fixed)
@@ -19,3 +19,5 @@
 #define PGDLLIMPORT __declspec (dllimport)
 
 #endif
+
+#define PGMODULEEXPORT __declspec (dllexport)
Index: src/include/port/win32.h
===================================================================
--- src/include/port/win32.h	(head)
+++ src/include/port/win32.h	(fixed)
@@ -57,6 +57,7 @@
 #else							/* not BUILDING_DLL */
 #define PGDLLIMPORT __declspec (dllimport)
 #endif
+#define PGMODULEEXPORT __declspec (dllexport)
 #else							/* not CYGWIN, not MSVC, not MingW */
 
 #define PGDLLIMPORT
