Skip to content

Commit 5fde861

Browse files
committed
Improve STRINGS_H macro test for MSVC extensions.
Add DLLIMPORT for V1 headers, in case Win32 don't export all symbols.
1 parent c1bb287 commit 5fde861

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/include/c.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Portions Copyright (c) 1996-2005, 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.197 2006/03/03 21:35:46 momjian Exp $
15+
* $PostgreSQL: pgsql/src/include/c.h,v 1.198 2006/03/05 04:43:57 momjian Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -57,6 +57,8 @@
5757
#else
5858
#if defined(_MSC_VER) || defined(__BORLANDC__)
5959
#define WIN32_CLIENT_ONLY
60+
/* Some use MinGW-generated pg_config.h but MSVC for extensions. */
61+
#undef HAVE_STRINGS_H
6062
#endif
6163
#endif
6264
#include "postgres_ext.h"
@@ -66,8 +68,7 @@
6668
#include <string.h>
6769
#include <stddef.h>
6870
#include <stdarg.h>
69-
/* Some use MinGW-generated pg_config.h but MSVC for extensions. */
70-
#if defined(HAVE_STRINGS_H) && !defined(WIN32_CLIENT_ONLY)
71+
#ifdef HAVE_STRINGS_H
7172
#include <strings.h>
7273
#endif
7374
#include <sys/types.h>

src/include/fmgr.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Portions Copyright (c) 1996-2005, 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.40 2005/10/15 02:49:41 momjian Exp $
14+
* $PostgreSQL: pgsql/src/include/fmgr.h,v 1.41 2006/03/05 04:43:57 momjian Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -293,10 +293,13 @@ typedef struct
293293
/* Expected signature of an info function */
294294
typedef Pg_finfo_record *(*PGFInfoFunction) (void);
295295

296-
/* Macro to build an info function associated with the given function name */
297-
296+
/*
297+
* Macro to build an info function associated with the given function name.
298+
* Win32 loadable functions usually link with 'dlltool --export-all', but it
299+
* doesn't hurt to add DLLIMPORT in case they don't.
300+
*/
298301
#define PG_FUNCTION_INFO_V1(funcname) \
299-
extern Pg_finfo_record * CppConcat(pg_finfo_,funcname) (void); \
302+
extern DLLIMPORT Pg_finfo_record * CppConcat(pg_finfo_,funcname) (void); \
300303
Pg_finfo_record * \
301304
CppConcat(pg_finfo_,funcname) (void) \
302305
{ \

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy