mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
Improve STRINGS_H macro test for MSVC extensions.
Add DLLIMPORT for V1 headers, in case Win32 don't export all symbols.
This commit is contained in:
@ -12,7 +12,7 @@
|
|||||||
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/include/c.h,v 1.197 2006/03/03 21:35:46 momjian Exp $
|
* $PostgreSQL: pgsql/src/include/c.h,v 1.198 2006/03/05 04:43:57 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -57,6 +57,8 @@
|
|||||||
#else
|
#else
|
||||||
#if defined(_MSC_VER) || defined(__BORLANDC__)
|
#if defined(_MSC_VER) || defined(__BORLANDC__)
|
||||||
#define WIN32_CLIENT_ONLY
|
#define WIN32_CLIENT_ONLY
|
||||||
|
/* Some use MinGW-generated pg_config.h but MSVC for extensions. */
|
||||||
|
#undef HAVE_STRINGS_H
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#include "postgres_ext.h"
|
#include "postgres_ext.h"
|
||||||
@ -66,8 +68,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
/* Some use MinGW-generated pg_config.h but MSVC for extensions. */
|
#ifdef HAVE_STRINGS_H
|
||||||
#if defined(HAVE_STRINGS_H) && !defined(WIN32_CLIENT_ONLY)
|
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#endif
|
#endif
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/include/fmgr.h,v 1.40 2005/10/15 02:49:41 momjian Exp $
|
* $PostgreSQL: pgsql/src/include/fmgr.h,v 1.41 2006/03/05 04:43:57 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -293,10 +293,13 @@ typedef struct
|
|||||||
/* Expected signature of an info function */
|
/* Expected signature of an info function */
|
||||||
typedef Pg_finfo_record *(*PGFInfoFunction) (void);
|
typedef Pg_finfo_record *(*PGFInfoFunction) (void);
|
||||||
|
|
||||||
/* Macro to build an info function associated with the given function name */
|
/*
|
||||||
|
* Macro to build an info function associated with the given function name.
|
||||||
|
* Win32 loadable functions usually link with 'dlltool --export-all', but it
|
||||||
|
* doesn't hurt to add DLLIMPORT in case they don't.
|
||||||
|
*/
|
||||||
#define PG_FUNCTION_INFO_V1(funcname) \
|
#define PG_FUNCTION_INFO_V1(funcname) \
|
||||||
extern Pg_finfo_record * CppConcat(pg_finfo_,funcname) (void); \
|
extern DLLIMPORT Pg_finfo_record * CppConcat(pg_finfo_,funcname) (void); \
|
||||||
Pg_finfo_record * \
|
Pg_finfo_record * \
|
||||||
CppConcat(pg_finfo_,funcname) (void) \
|
CppConcat(pg_finfo_,funcname) (void) \
|
||||||
{ \
|
{ \
|
||||||
|
Reference in New Issue
Block a user