summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorItagaki Takahiro2010-05-27 07:59:48 +0000
committerItagaki Takahiro2010-05-27 07:59:48 +0000
commit77e50a61ffff34aae8cb3ffa5a7333c1049e5f37 (patch)
treed1f60f1db2d0201e1a4fdf5a37c8bc153a47f3fb
parentaa5bec67dee9bbd9929a468211d004c448859635 (diff)
Mark PG_MODULE_MAGIC and PG_FUNCTION_INFO_V1 with PGDLLEXPORT
independently from BUILDING_DLL. It is always __declspec(dllexport).
-rw-r--r--src/include/c.h8
-rw-r--r--src/include/fmgr.h6
-rw-r--r--src/include/port/cygwin.h5
-rw-r--r--src/include/port/win32.h7
4 files changed, 17 insertions, 9 deletions
diff --git a/src/include/c.h b/src/include/c.h
index f63dd20bace..bec1a8cc851 100644
--- a/src/include/c.h
+++ b/src/include/c.h
@@ -12,7 +12,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/c.h,v 1.240 2010/02/26 02:01:20 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/c.h,v 1.241 2010/05/27 07:59:48 itagaki Exp $
*
*-------------------------------------------------------------------------
*/
@@ -784,8 +784,12 @@ extern int vsnprintf(char *str, size_t count, const char *fmt, va_list args);
#define memmove(d, s, c) bcopy(s, d, c)
#endif
+/* no special DLL markers on most ports */
#ifndef PGDLLIMPORT
-#define PGDLLIMPORT /* no special DLL markers on most ports */
+#define PGDLLIMPORT
+#endif
+#ifndef PGDLLEXPORT
+#define PGDLLEXPORT
#endif
/*
diff --git a/src/include/fmgr.h b/src/include/fmgr.h
index cf74f97cc0c..e588bb15d2f 100644
--- a/src/include/fmgr.h
+++ b/src/include/fmgr.h
@@ -11,7 +11,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/fmgr.h,v 1.65 2010/02/26 02:01:20 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/fmgr.h,v 1.66 2010/05/27 07:59:48 itagaki Exp $
*
*-------------------------------------------------------------------------
*/
@@ -328,7 +328,7 @@ typedef const Pg_finfo_record *(*PGFInfoFunction) (void);
* 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 PGDLLEXPORT const Pg_finfo_record * CppConcat(pg_finfo_,funcname)(void); \
const Pg_finfo_record * \
CppConcat(pg_finfo_,funcname) (void) \
{ \
@@ -397,7 +397,7 @@ typedef const Pg_magic_struct *(*PGModuleMagicFunction) (void);
#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 PGDLLEXPORT const Pg_magic_struct *PG_MAGIC_FUNCTION_NAME(void); \
const Pg_magic_struct * \
PG_MAGIC_FUNCTION_NAME(void) \
{ \
diff --git a/src/include/port/cygwin.h b/src/include/port/cygwin.h
index 6d46f0c774f..cb88bc08901 100644
--- a/src/include/port/cygwin.h
+++ b/src/include/port/cygwin.h
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/src/include/port/cygwin.h,v 1.7 2007/07/25 12:22:53 mha Exp $ */
+/* $PostgreSQL: pgsql/src/include/port/cygwin.h,v 1.8 2010/05/27 07:59:48 itagaki Exp $ */
#include <cygwin/version.h>
@@ -17,5 +17,6 @@
#define PGDLLIMPORT __declspec (dllexport)
#else
#define PGDLLIMPORT __declspec (dllimport)
-
#endif
+
+#define PGDLLEXPORT __declspec (dllexport)
diff --git a/src/include/port/win32.h b/src/include/port/win32.h
index 6dbda80f4fb..d5d309bc13e 100644
--- a/src/include/port/win32.h
+++ b/src/include/port/win32.h
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.93 2010/02/16 19:26:02 mha Exp $ */
+/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.94 2010/05/27 07:59:48 itagaki Exp $ */
#if defined(_MSC_VER) || defined(__BORLANDC__)
#define WIN32_ONLY_COMPILER
@@ -57,9 +57,12 @@
#else /* not BUILDING_DLL */
#define PGDLLIMPORT __declspec (dllimport)
#endif
-#else /* not CYGWIN, not MSVC, not MingW */
+#define PGDLLEXPORT __declspec (dllexport)
+
+#else /* not CYGWIN, not MSVC, not MingW */
#define PGDLLIMPORT
+#define PGDLLEXPORT
#endif