Skip to content

Commit 77e50a6

Browse files
committed
Mark PG_MODULE_MAGIC and PG_FUNCTION_INFO_V1 with PGDLLEXPORT
independently from BUILDING_DLL. It is always __declspec(dllexport).
1 parent aa5bec6 commit 77e50a6

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

src/include/c.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
1313
* Portions Copyright (c) 1994, Regents of the University of California
1414
*
15-
* $PostgreSQL: pgsql/src/include/c.h,v 1.240 2010/02/26 02:01:20 momjian Exp $
15+
* $PostgreSQL: pgsql/src/include/c.h,v 1.241 2010/05/27 07:59:48 itagaki Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -784,8 +784,12 @@ extern int vsnprintf(char *str, size_t count, const char *fmt, va_list args);
784784
#define memmove(d, s, c) bcopy(s, d, c)
785785
#endif
786786

787+
/* no special DLL markers on most ports */
787788
#ifndef PGDLLIMPORT
788-
#define PGDLLIMPORT /* no special DLL markers on most ports */
789+
#define PGDLLIMPORT
790+
#endif
791+
#ifndef PGDLLEXPORT
792+
#define PGDLLEXPORT
789793
#endif
790794

791795
/*

src/include/fmgr.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
1212
* Portions Copyright (c) 1994, Regents of the University of California
1313
*
14-
* $PostgreSQL: pgsql/src/include/fmgr.h,v 1.65 2010/02/26 02:01:20 momjian Exp $
14+
* $PostgreSQL: pgsql/src/include/fmgr.h,v 1.66 2010/05/27 07:59:48 itagaki Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -328,7 +328,7 @@ typedef const Pg_finfo_record *(*PGFInfoFunction) (void);
328328
* doesn't hurt to add PGDLLIMPORT in case they don't.
329329
*/
330330
#define PG_FUNCTION_INFO_V1(funcname) \
331-
extern PGDLLIMPORT const Pg_finfo_record * CppConcat(pg_finfo_,funcname)(void); \
331+
extern PGDLLEXPORT const Pg_finfo_record * CppConcat(pg_finfo_,funcname)(void); \
332332
const Pg_finfo_record * \
333333
CppConcat(pg_finfo_,funcname) (void) \
334334
{ \
@@ -397,7 +397,7 @@ typedef const Pg_magic_struct *(*PGModuleMagicFunction) (void);
397397
#define PG_MAGIC_FUNCTION_NAME_STRING "Pg_magic_func"
398398

399399
#define PG_MODULE_MAGIC \
400-
extern PGDLLIMPORT const Pg_magic_struct *PG_MAGIC_FUNCTION_NAME(void); \
400+
extern PGDLLEXPORT const Pg_magic_struct *PG_MAGIC_FUNCTION_NAME(void); \
401401
const Pg_magic_struct * \
402402
PG_MAGIC_FUNCTION_NAME(void) \
403403
{ \

src/include/port/cygwin.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/include/port/cygwin.h,v 1.7 2007/07/25 12:22:53 mha Exp $ */
1+
/* $PostgreSQL: pgsql/src/include/port/cygwin.h,v 1.8 2010/05/27 07:59:48 itagaki Exp $ */
22

33
#include <cygwin/version.h>
44

@@ -17,5 +17,6 @@
1717
#define PGDLLIMPORT __declspec (dllexport)
1818
#else
1919
#define PGDLLIMPORT __declspec (dllimport)
20-
2120
#endif
21+
22+
#define PGDLLEXPORT __declspec (dllexport)

src/include/port/win32.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.93 2010/02/16 19:26:02 mha Exp $ */
1+
/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.94 2010/05/27 07:59:48 itagaki Exp $ */
22

33
#if defined(_MSC_VER) || defined(__BORLANDC__)
44
#define WIN32_ONLY_COMPILER
@@ -57,9 +57,12 @@
5757
#else /* not BUILDING_DLL */
5858
#define PGDLLIMPORT __declspec (dllimport)
5959
#endif
60-
#else /* not CYGWIN, not MSVC, not MingW */
6160

61+
#define PGDLLEXPORT __declspec (dllexport)
62+
63+
#else /* not CYGWIN, not MSVC, not MingW */
6264
#define PGDLLIMPORT
65+
#define PGDLLEXPORT
6366
#endif
6467

6568

0 commit comments

Comments
 (0)