Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit04c8d4c

Browse files
committed
libpq++/pgconnection.h must not include postgres_fe.h, else it fails to
compile in client apps that use the standard installed header set.To allow removing that include, move DLLIMPORT definitions out of c.hand into the appropriate port-specific header files.
1 parentc64f083 commit04c8d4c

File tree

6 files changed

+96
-26
lines changed

6 files changed

+96
-26
lines changed

‎src/include/c.h

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
1313
* Portions Copyright (c) 1994, Regents of the University of California
1414
*
15-
* $Id: c.h,v 1.113 2001/12/03 17:44:52 tgl Exp $
15+
* $Id: c.h,v 1.114 2002/01/22 19:02:39 tgl Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -620,27 +620,8 @@ typedef NameData *Name;
620620
/* These are for things that are one way on Unix and another on NT */
621621
#defineNULL_DEV"/dev/null"
622622

623-
/* defines for dynamic linking on Win32 platform */
624-
#ifdef__CYGWIN__
625-
#if__GNUC__&& ! defined (__declspec)
626-
#error You need egcs 1.1 or newer for compiling!
627-
#endif
628-
#ifdefBUILDING_DLL
629-
#defineDLLIMPORT __declspec (dllexport)
630-
#else/* not BUILDING_DLL */
631-
#defineDLLIMPORT __declspec (dllimport)
632-
#endif
633-
#elif defined(WIN32)&& defined(_MSC_VER)/* not CYGWIN */
634-
#if defined(_DLL)
635-
#defineDLLIMPORT __declspec (dllexport)
636-
#else/* not _DLL */
637-
#defineDLLIMPORT __declspec (dllimport)
638-
#endif
639-
#else/* not CYGWIN, not MSVC */
640-
#defineDLLIMPORT
641-
#endif
642-
643-
/* Provide prototypes for routines not present in a particular machine's
623+
/*
624+
* Provide prototypes for routines not present in a particular machine's
644625
* standard C library.It'd be better to put these in pg_config.h, but
645626
* in pg_config.h we haven't yet included anything that defines size_t...
646627
*/

‎src/include/pg_config.h.in

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* or in pg_config.h afterwards. Of course, if you edit pg_config.h, then your
99
* changes will be overwritten the next time you run configure.
1010
*
11-
* $Id: pg_config.h.in,v 1.15 2001/12/03 17:44:52 tgl Exp $
11+
* $Id: pg_config.h.in,v 1.16 2002/01/22 19:02:40 tgl Exp $
1212
*/
1313

1414
#ifndefPG_CONFIG_H
@@ -720,10 +720,19 @@ extern int fdatasync(int fildes);
720720

721721
#include"pg_config_os.h"
722722

723+
/*
724+
* Provide default definitions for things that port-specific pg_config_os.h
725+
* files can set, but typically don't.
726+
*/
727+
728+
#ifndefDLLIMPORT
729+
#defineDLLIMPORT/* no special DLL markers on most ports */
730+
#endif
731+
723732
/*
724733
* The following is used as the arg list for signal handlers. Any ports
725734
* that take something other than an int argument should override this in
726-
*the port-specific pg_config_os.h file. Note that variable names are required
735+
*their pg_config_os.h file. Note that variable names are required
727736
* because it is used in both the prototypes as well as the definitions.
728737
* Note also the long name. We expect that this won't collide with
729738
* other names causing compiler warnings.

‎src/include/pg_config.h.win32

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,32 @@
2929
/* use _snprintf instead of snprintf */
3030
#defineHAVE_SNPRINTF_DECL
3131
#define snprintf_snprintf
32+
33+
/* defines for dynamic linking on Win32 platform */
34+
#ifdef __CYGWIN__
35+
36+
#if __GNUC__ && ! defined (__declspec)
37+
#error You need egcs 1.1 or newer for compiling!
38+
#endif
39+
40+
#ifdef BUILDING_DLL
41+
#define DLLIMPORT __declspec (dllexport)
42+
#else/* not BUILDING_DLL */
43+
#define DLLIMPORT __declspec (dllimport)
44+
#endif
45+
46+
#elif defined(WIN32) && defined(_MSC_VER)/* not CYGWIN */
47+
48+
#if defined(_DLL)
49+
#define DLLIMPORT __declspec (dllexport)
50+
#else/* not _DLL */
51+
#define DLLIMPORT __declspec (dllimport)
52+
#endif
53+
54+
#else/* not CYGWIN, not MSVC */
55+
56+
#define DLLIMPORT
57+
58+
#endif
59+
3260
#endif /* pg_config_h_win32__ */

‎src/include/port/win.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,31 @@ typedef unsigned char slock_t;
1515
*/
1616
#ifCYGWIN_VERSION_DLL_MAJOR<1001
1717
#undef HAVE_UNIX_SOCKETS
18+
#endif
19+
20+
/* defines for dynamic linking on Win32 platform */
21+
#ifdef__CYGWIN__
22+
23+
#if__GNUC__&& ! defined (__declspec)
24+
#error You need egcs 1.1 or newer for compiling!
25+
#endif
26+
27+
#ifdefBUILDING_DLL
28+
#defineDLLIMPORT __declspec (dllexport)
29+
#else/* not BUILDING_DLL */
30+
#defineDLLIMPORT __declspec (dllimport)
31+
#endif
32+
33+
#elif defined(WIN32)&& defined(_MSC_VER)/* not CYGWIN */
34+
35+
#if defined(_DLL)
36+
#defineDLLIMPORT __declspec (dllexport)
37+
#else/* not _DLL */
38+
#defineDLLIMPORT __declspec (dllimport)
39+
#endif
40+
41+
#else/* not CYGWIN, not MSVC */
42+
43+
#defineDLLIMPORT
1844

1945
#endif

‎src/include/port/win32.h

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,29 @@
11
#defineUSES_WINSOCK
22
#defineNOFILE 100
3+
4+
/* defines for dynamic linking on Win32 platform */
5+
#ifdef__CYGWIN__
6+
7+
#if__GNUC__&& ! defined (__declspec)
8+
#error You need egcs 1.1 or newer for compiling!
9+
#endif
10+
11+
#ifdefBUILDING_DLL
12+
#defineDLLIMPORT __declspec (dllexport)
13+
#else/* not BUILDING_DLL */
14+
#defineDLLIMPORT __declspec (dllimport)
15+
#endif
16+
17+
#elif defined(WIN32)&& defined(_MSC_VER)/* not CYGWIN */
18+
19+
#if defined(_DLL)
20+
#defineDLLIMPORT __declspec (dllexport)
21+
#else/* not _DLL */
22+
#defineDLLIMPORT __declspec (dllimport)
23+
#endif
24+
25+
#else/* not CYGWIN, not MSVC */
26+
27+
#defineDLLIMPORT
28+
29+
#endif

‎src/interfaces/libpq++/pgconnection.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
1414
* Portions Copyright (c) 1994, Regents of the University of California
1515
*
16-
* $Id: pgconnection.h,v 1.14 2001/09/30 22:30:37 tgl Exp $
16+
* $Id: pgconnection.h,v 1.15 2002/01/22 19:02:40 tgl Exp $
1717
*
1818
*-------------------------------------------------------------------------
1919
*/
@@ -38,7 +38,6 @@ extern "C" {
3838
#endif
3939

4040
extern"C" {
41-
#include"postgres_fe.h"
4241
#include"libpq-fe.h"
4342
}
4443

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp