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

Commite1c8b37

Browse files
committed
Add new macro as shorthand for MS VC and Borland C++:
+ #if defined(_MSC_VER) || defined(__BORLANDC__)+ #define WIN32_CLIENT_ONLY+ #endif
1 parente017051 commite1c8b37

File tree

11 files changed

+31
-28
lines changed

11 files changed

+31
-28
lines changed

‎src/backend/libpq/ip.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/libpq/ip.c,v 1.28 2004/08/29 05:06:43 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/libpq/ip.c,v 1.29 2004/09/27 23:24:30 momjian Exp $
1212
*
1313
* This file and the IPV6 implementation were initially provided by
1414
* Nigel Kukard <nkukard@lbsd.net>, Linux Based Systems Design
@@ -20,8 +20,7 @@
2020
/* This is intended to be used in both frontend and backend, so use c.h */
2121
#include"c.h"
2222

23-
#if !defined(_MSC_VER)&& !defined(__BORLANDC__)
24-
23+
#ifndefWIN32_CLIENT_ONLY
2524
#include<errno.h>
2625
#include<unistd.h>
2726
#include<sys/types.h>
@@ -34,8 +33,7 @@
3433
#endif
3534
#include<arpa/inet.h>
3635
#include<sys/file.h>
37-
#endif/* !defined(_MSC_VER) &&
38-
* !defined(__BORLANDC__) */
36+
#endif
3937

4038
#include"libpq/ip.h"
4139

‎src/backend/utils/mb/encnames.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Encoding names and routines for work with it. All
33
* in this file is shared bedween FE and BE.
44
*
5-
* $PostgreSQL: pgsql/src/backend/utils/mb/encnames.c,v 1.19 2004/09/17 21:59:57 petere Exp $
5+
* $PostgreSQL: pgsql/src/backend/utils/mb/encnames.c,v 1.20 2004/09/27 23:24:33 momjian Exp $
66
*/
77
#ifdefFRONTEND
88
#include"postgres_fe.h"
@@ -13,7 +13,7 @@
1313
#include"utils/builtins.h"
1414
#endif
1515

16-
#if !defined(_MSC_VER)&& !defined(__BORLANDC__)
16+
#ifndefWIN32_CLIENT_ONLY
1717
#include<unistd.h>
1818
#endif
1919

‎src/bin/psql/print.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2004, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.51 2004/08/29 05:06:54 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.52 2004/09/27 23:24:35 momjian Exp $
77
*/
88
#include"postgres_fe.h"
99
#include"common.h"
@@ -12,7 +12,7 @@
1212
#include<math.h>
1313
#include<signal.h>
1414

15-
#if !defined(_MSC_VER)&& !defined(__BORLANDC__)
15+
#ifndefWIN32_CLIENT_ONLY
1616
#include<unistd.h>
1717
#endif
1818

‎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-2004, 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.176 2004/09/2722:11:22 momjian Exp $
15+
* $PostgreSQL: pgsql/src/include/c.h,v 1.177 2004/09/2723:24:37 momjian Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -54,6 +54,10 @@
5454
#include"pg_config_manual.h"/* must be after pg_config.h */
5555
#if !defined(WIN32)&& !defined(__CYGWIN__)
5656
#include"pg_config_os.h"/* must be before any system header files */
57+
#else
58+
#ifdefined(_MSC_VER)|| defined(__BORLANDC__)
59+
#defineWIN32_CLIENT_ONLY
60+
#endif
5761
#endif
5862
#include"postgres_ext.h"
5963

@@ -76,7 +80,7 @@
7680
#endif
7781

7882
#if defined(WIN32)|| defined(__CYGWIN__)
79-
#if!defined(_MSC_VER)&& !defined(__BORLANDC__)
83+
#ifndefWIN32_CLIENT_ONLY
8084
/* We have to redefine some system functions after they are included above */
8185
#include"pg_config_os.h"
8286
#else

‎src/include/getaddrinfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
*
1616
* Copyright (c) 2003, PostgreSQL Global Development Group
1717
*
18-
* $PostgreSQL: pgsql/src/include/getaddrinfo.h,v 1.12 2003/11/29 22:40:53 pgsql Exp $
18+
* $PostgreSQL: pgsql/src/include/getaddrinfo.h,v 1.13 2004/09/27 23:24:37 momjian Exp $
1919
*
2020
*-------------------------------------------------------------------------
2121
*/
2222
#ifndefGETADDRINFO_H
2323
#defineGETADDRINFO_H
2424

25-
#if !defined(_MSC_VER)&& !defined(__BORLANDC__)
25+
#ifndefWIN32_CLIENT_ONLY
2626
#include<sys/socket.h>
2727
#include<netdb.h>
2828
#endif

‎src/include/port.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@
66
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $PostgreSQL: pgsql/src/include/port.h,v 1.62 2004/09/2720:37:20 momjian Exp $
9+
* $PostgreSQL: pgsql/src/include/port.h,v 1.63 2004/09/2723:24:37 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
1313

14-
#if !defined(_MSC_VER)&& !defined(__BORLANDC__)
14+
#ifndefWIN32_CLIENT_ONLY
1515
/* for thread.c */
1616
#include<pwd.h>
1717
#include<netdb.h>
1818
#endif
19+
1920
#include<ctype.h>
2021

2122
/* non-blocking */
@@ -169,7 +170,7 @@ extern intpgunlink(const char *path);
169170
externintpgsymlink(constchar*oldpath,constchar*newpath);
170171

171172
/* Include this first so later includes don't see these defines */
172-
#ifdef_MSC_VER
173+
#ifdefWIN32_CLIENT_ONLY
173174
#include<io.h>
174175
#endif
175176

@@ -183,7 +184,7 @@ extern bool rmtree(char *path, bool rmtopdir);
183184
#ifdefWIN32
184185

185186
/* open() replacement to allow delete of held files */
186-
#if !defined(_MSC_VER)&& !defined(__BORLANDC__)
187+
#ifndefWIN32_CLIENT_ONLY
187188
externintwin32_open(constchar*,int,...);
188189

189190
#defineopen(a,b,...)win32_open(a,b,##__VA_ARGS__)
@@ -242,7 +243,7 @@ extern double rint(double x);
242243
#endif
243244

244245
#ifndefHAVE_INET_ATON
245-
#if !defined(_MSC_VER)&& !defined(__BORLANDC__)
246+
#ifndefWIN32_CLIENT_ONLY
246247
#include<netinet/in.h>
247248
#include<arpa/inet.h>
248249
#endif

‎src/include/port/win32.h

Lines changed: 2 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.33 2004/09/14 03:50:17 tgl Exp $ */
1+
/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.34 2004/09/27 23:24:40 momjian Exp $ */
22

33
/* undefine and redefine after #include */
44
#undef mkdir
@@ -31,7 +31,7 @@
3131
#defineDLLIMPORT __declspec (dllimport)
3232
#endif
3333

34-
#elif defined(WIN32)&& (defined(_MSC_VER)|| defined(__BORLANDC__))/* not CYGWIN or MingW */
34+
#elif defined(WIN32_CLIENT_ONLY)
3535

3636
#if defined(_DLL)
3737
#defineDLLIMPORT __declspec (dllexport)

‎src/interfaces/libpq/fe-misc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* Portions Copyright (c) 1994, Regents of the University of California
2424
*
2525
* IDENTIFICATION
26-
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-misc.c,v 1.110 2004/08/29 05:07:00 momjian Exp $
26+
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-misc.c,v 1.111 2004/09/27 23:24:42 momjian Exp $
2727
*
2828
*-------------------------------------------------------------------------
2929
*/
@@ -34,7 +34,7 @@
3434
#include<signal.h>
3535
#include<time.h>
3636

37-
#if !defined(_MSC_VER)&& !defined(__BORLANDC__)
37+
#ifndefWIN32_CLIENT_ONLY
3838
#include<netinet/in.h>
3939
#include<arpa/inet.h>
4040
#endif

‎src/port/getaddrinfo.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
* Copyright (c) 2003, PostgreSQL Global Development Group
1313
*
1414
* IDENTIFICATION
15-
* $PostgreSQL: pgsql/src/port/getaddrinfo.c,v 1.12 2003/11/29 19:52:13 pgsql Exp $
15+
* $PostgreSQL: pgsql/src/port/getaddrinfo.c,v 1.13 2004/09/27 23:24:45 momjian Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
1919

2020
/* This is intended to be used in both frontend and backend, so use c.h */
2121
#include"c.h"
2222

23-
#if !defined(_MSC_VER)&& !defined(__BORLANDC__)
23+
#ifndefWIN32_CLIENT_ONLY
2424
#include<sys/types.h>
2525
#include<sys/socket.h>
2626
#include<netdb.h>

‎src/port/inet_aton.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/port/inet_aton.c,v 1.6 2003/11/29 22:41:31 pgsql Exp $
1+
/* $PostgreSQL: pgsql/src/port/inet_aton.c,v 1.7 2004/09/27 23:24:45 momjian Exp $
22
*
33
*This inet_aton() function was taken from the GNU C library and
44
*incorporated into Postgres for those systems which do not have this
@@ -44,7 +44,7 @@
4444

4545
#include"c.h"
4646

47-
#if !defined(_MSC_VER)&& !defined(__BORLANDC__)
47+
#ifndefWIN32_CLIENT_ONLY
4848
#include<netinet/in.h>
4949
#include<ctype.h>
5050
#endif

‎src/port/thread.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
99
*
10-
* $PostgreSQL: pgsql/src/port/thread.c,v 1.25 2004/08/29 05:07:02 momjian Exp $
10+
* $PostgreSQL: pgsql/src/port/thread.c,v 1.26 2004/09/27 23:24:45 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -16,7 +16,7 @@
1616

1717
#include<sys/types.h>
1818
#include<errno.h>
19-
#if defined(WIN32)&& (defined(_MSC_VER)|| defined(__BORLANDC__))
19+
#ifdefWIN32_CLIENT_ONLY
2020
#undef ERROR
2121
#else
2222
#include<pwd.h>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp