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

Commit422d481

Browse files
committed
Corrects issues recently posted by Dann Corbit, allowing libpq/psql to
be built under VC++. Moves a pgstat win32 #def to port.hClaudio Natoli
1 parent823ac7c commit422d481

File tree

6 files changed

+32
-19
lines changed

6 files changed

+32
-19
lines changed

‎src/backend/postmaster/pgstat.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*
1414
*Copyright (c) 2001-2003, PostgreSQL Global Development Group
1515
*
16-
*$PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.64 2004/03/27 17:59:35 momjian Exp $
16+
*$PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.65 2004/04/05 03:16:21 momjian Exp $
1717
* ----------
1818
*/
1919
#include"postgres.h"
@@ -143,19 +143,6 @@ static void pgstat_recv_tabpurge(PgStat_MsgTabpurge *msg, int len);
143143
staticvoidpgstat_recv_dropdb(PgStat_MsgDropdb*msg,intlen);
144144
staticvoidpgstat_recv_resetcounter(PgStat_MsgResetcounter*msg,intlen);
145145

146-
/*
147-
*WIN32 doesn't allow descriptors returned by pipe() to be used in select(),
148-
*so for that platform we use socket() instead of pipe().
149-
*/
150-
#ifndefWIN32
151-
#definepgpipe(a)pipe(a)
152-
#definepiperead(a,b,c)read(a,b,c)
153-
#definepipewrite(a,b,c)write(a,b,c)
154-
#else
155-
externintpgpipe(inthandles[2]);/* pgpipe() is in /src/port */
156-
#definepiperead(a,b,c)recv(a,b,c,0)
157-
#definepipewrite(a,b,c)send(a,b,c,0)
158-
#endif
159146

160147
/* ------------------------------------------------------------
161148
* Public functions called from postmaster follow

‎src/bin/psql/win32.mak

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ CLEAN :
3232
-@erase"$(INTDIR)\large_obj.obj"
3333
-@erase"$(INTDIR)\print.obj"
3434
-@erase"$(INTDIR)\describe.obj"
35+
-@erase"$(INTDIR)\psqlscan.obj"
3536
-@erase"$(INTDIR)\tab-complete.obj"
3637
-@erase"$(INTDIR)\sprompt.obj"
3738
-@erase"$(INTDIR)\getopt.obj"
@@ -70,6 +71,7 @@ LINK32_OBJS= \
7071
"$(INTDIR)\large_obj.obj"\
7172
"$(INTDIR)\print.obj"\
7273
"$(INTDIR)\describe.obj"\
74+
"$(INTDIR)\psqlscan.obj"\
7375
"$(INTDIR)\tab-complete.obj"\
7476
"$(INTDIR)\sprompt.obj"\
7577
"$(INTDIR)\getopt.obj"\
@@ -115,4 +117,3 @@ LINK32_OBJS= \
115117

116118
sql_help.h: create_help.pl
117119
$(PERL) create_help.pl $(REFDOCDIR) $@
118-

‎src/include/libpq/libpq-be.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@
1111
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
1212
* Portions Copyright (c) 1994, Regents of the University of California
1313
*
14-
* $PostgreSQL: pgsql/src/include/libpq/libpq-be.h,v 1.43 2004/03/19 02:23:59 tgl Exp $
14+
* $PostgreSQL: pgsql/src/include/libpq/libpq-be.h,v 1.44 2004/04/05 03:16:21 momjian Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
1818
#ifndefLIBPQ_BE_H
1919
#defineLIBPQ_BE_H
2020

21+
#ifndef_MSC_VER
2122
#include<sys/time.h>
23+
#endif
2224
#ifdefUSE_SSL
2325
#include<openssl/ssl.h>
2426
#include<openssl/err.h>

‎src/include/port.h

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2003, 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.23 2004/03/24 03:54:16 momjian Exp $
9+
* $PostgreSQL: pgsql/src/include/port.h,v 1.24 2004/04/05 03:16:21 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -38,22 +38,37 @@ extern intfseeko(FILE *stream, off_t offset, int whence);
3838
externoff_tftello(FILE*stream);
3939
#endif
4040

41-
#if defined(WIN32)|| defined(__CYGWIN__)
41+
/*
42+
*WIN32 doesn't allow descriptors returned by pipe() to be used in select(),
43+
*so for that platform we use socket() instead of pipe().
44+
*/
45+
#ifndefWIN32
46+
#definepgpipe(a)pipe(a)
47+
#definepiperead(a,b,c)read(a,b,c)
48+
#definepipewrite(a,b,c)write(a,b,c)
49+
#else
50+
externintpgpipe(inthandles[2]);
51+
#definepiperead(a,b,c)recv(a,b,c,0)
52+
#definepipewrite(a,b,c)send(a,b,c,0)
53+
#endif
54+
55+
#if defined(__MINGW32__)|| defined(__CYGWIN__)
4256
/*
4357
* Win32 doesn't have reliable rename/unlink during concurrent access
4458
*/
4559
externintpgrename(constchar*from,constchar*to);
4660
externintpgunlink(constchar*path);
47-
4861
#definerename(from,to)pgrename(from, to)
4962
#defineunlink(path)pgunlink(path)
5063
#endif
5164

5265
#ifdefWIN32
5366

5467
/* open() replacement to allow delete of held files */
68+
#ifndef_MSC_VER
5569
externintwin32_open(constchar*,int,...);
5670
#defineopen(a,b,...)win32_open(a,b,##__VA_ARGS__)
71+
#endif
5772

5873
externintcopydir(char*fromdir,char*todir);
5974

‎src/interfaces/libpq/libpqdll.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,4 @@ EXPORTS
113113
PQfformat @ 109
114114
PQexecPrepared @ 110
115115
PQsendQueryPrepared @ 111
116+
PQdsplen @ 112

‎src/interfaces/libpq/win32.mak

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ CLEAN :
4848
-@erase"$(INTDIR)\thread.obj"
4949
-@erase"$(INTDIR)\inet_aton.obj"
5050
-@erase"$(INTDIR)\crypt.obj"
51+
-@erase"$(INTDIR)\noblock.obj"
5152
-@erase"$(INTDIR)\path.obj"
5253
-@erase"$(INTDIR)\dllist.obj"
5354
-@erase"$(INTDIR)\md5.obj"
@@ -96,6 +97,7 @@ LIB32_OBJS= \
9697
"$(INTDIR)\thread.obj"\
9798
"$(INTDIR)\inet_aton.obj"\
9899
"$(INTDIR)\crypt.obj"\
100+
"$(INTDIR)\noblock.obj"\
99101
"$(INTDIR)\path.obj"\
100102
"$(INTDIR)\dllist.obj"\
101103
"$(INTDIR)\md5.obj"\
@@ -161,6 +163,11 @@ LINK32_OBJS= \
161163
$(CPP_PROJ) ..\..\port\crypt.c
162164
<<
163165

166+
"$(INTDIR)\noblock.obj" : ..\..\port\noblock.c
167+
$(CPP) @<<
168+
$(CPP_PROJ) ..\..\port\noblock.c
169+
<<
170+
164171
"$(INTDIR)\path.obj" : ..\..\port\path.c
165172
$(CPP) @<<
166173
$(CPP_PROJ) ..\..\port\path.c

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp