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

Commita060d5b

Browse files
committed
Hello!
Here is a new patch for libpq, to make it work on Win32 again (sincethe latest modifications broke it a little).Please also add the file "libpq.rc" to the interfaces/libpq directory.This will allow version-stamping of the generated DLL file, so thatautomatic install programs (and interested users) can determinethe version of the file. The file is currently set as "prerelease".Before the release, somebody should change the line "FILEFLAGSVS_FF_PRERELEASE" to "FILEFLAGS 0". That information should probablygo into toos\RELEASE_CHANGES.The patch is against the cvs as of ~ 1998-08-26 14:30 CEST.//Magnus
1 parentd15c37c commita060d5b

File tree

5 files changed

+47
-17
lines changed

5 files changed

+47
-17
lines changed

‎src/bin/psql/psql.c

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.156 1998/08/27 13:25:18 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.157 1998/08/29 04:05:39 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -89,7 +89,8 @@ char *__progname = "psql";
8989
#definePROMPT_READY'='
9090
#definePROMPT_CONTINUE '-'
9191
#definePROMPT_COMMENT'*'
92-
#definePROMPT_QUOTE'\''
92+
#definePROMPT_SINGLEQUOTE'\''
93+
#definePROMPT_DOUBLEQUOTE'"'
9394

9495
/* Backslash command handling:
9596
*0 - send currently constructed query to backend (i.e. we got a \g)
@@ -2310,7 +2311,7 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source)
23102311

23112312
/* We've reached the end of our command input. */
23122313
boolsuccess;
2313-
boolin_quote;
2314+
charin_quote;/* == 0 for no in_quote */
23142315
boolwas_bslash;/* backslash */
23152316
intparen_level;
23162317
char*query_start;
@@ -2380,8 +2381,10 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source)
23802381
{
23812382
if (interactive&& !pset->quiet)
23822383
{
2383-
if (in_quote)
2384-
pset->prompt[strlen(pset->prompt)-3]=PROMPT_QUOTE;
2384+
if (in_quote&&in_quote==PROMPT_SINGLEQUOTE)
2385+
pset->prompt[strlen(pset->prompt)-3]=PROMPT_SINGLEQUOTE;
2386+
elseif (in_quote&&in_quote==PROMPT_DOUBLEQUOTE)
2387+
pset->prompt[strlen(pset->prompt)-3]=PROMPT_DOUBLEQUOTE;
23852388
elseif (xcomment!=NULL)
23862389
pset->prompt[strlen(pset->prompt)-3]=PROMPT_COMMENT;
23872390
elseif (query[0]!='\0'&& !querySent)
@@ -2500,7 +2503,7 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source)
25002503
was_bslash= true;
25012504

25022505
/* inside a quote? */
2503-
if (in_quote&& (line[i]!='\''||was_bslash))
2506+
if (in_quote&& (line[i]!=in_quote||was_bslash))
25042507
/* do nothing */ ;
25052508
elseif (xcomment!=NULL)/* inside an extended
25062509
* comment? */
@@ -2548,8 +2551,10 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source)
25482551
line[i]='\0';/* remove comment */
25492552
break;
25502553
}
2551-
elseif (line[i]== '\'')
2552-
in_quote ^=1;
2554+
elseif (in_quote&&line[i]==in_quote)
2555+
in_quote= false;
2556+
elseif (!in_quote&& (line[i]=='\''||line[i]=='"'))
2557+
in_quote=line[i];
25532558
/* semi-colon? then send query now */
25542559
elseif (!paren_level&&line[i]==';')
25552560
{

‎src/include/c.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: c.h,v 1.43 1998/08/25 21:04:41scrappy Exp $
10+
* $Id: c.h,v 1.44 1998/08/2904:05:41momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -133,7 +133,9 @@ typedef char *Pointer;
133133
* Example:
134134
*extern const VersionRomVersion;
135135
*/
136+
#ifndefWIN32
136137
#defineconst/* const */
138+
#endif
137139

138140
/*
139141
* signed --

‎src/include/libpq/pqcomm.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: pqcomm.h,v 1.27 1998/08/22 04:24:18 momjian Exp $
9+
* $Id: pqcomm.h,v 1.28 1998/08/29 04:05:43 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -15,20 +15,25 @@
1515

1616
#include<stdio.h>
1717
#include<sys/types.h>
18+
#ifdefWIN32
19+
#include<winsock.h>
20+
#else
1821
#include<sys/socket.h>
1922
#include<sys/un.h>
2023
#include<netinet/in.h>
24+
#endif
2125

2226
#include"c.h"
2327

24-
2528
/* Define a generic socket address type. */
2629

2730
typedefunionSockAddr
2831
{
2932
structsockaddrsa;
3033
structsockaddr_inin;
34+
#ifndefWIN32
3135
structsockaddr_unun;
36+
#endif
3237
}SockAddr;
3338

3439

‎src/interfaces/libpq/libpq-fe.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: libpq-fe.h,v 1.38 1998/08/17 03:50:40 scrappy Exp $
9+
* $Id: libpq-fe.h,v 1.39 1998/08/29 04:05:45 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -21,9 +21,13 @@ extern"C"
2121

2222
#include<stdio.h>
2323
/* these wouldn't need to be included if PGSockAddr weren't exported: */
24+
#ifdefWIN32
25+
#include<winsock.h>
26+
#else
2427
#include<sys/socket.h>
2528
#include<sys/un.h>
2629
#include<netinet/in.h>
30+
#endif
2731
/* ----------------
2832
*include stuff common to fe and be
2933
* ----------------
@@ -141,7 +145,9 @@ extern"C"
141145
{
142146
structsockaddrsa;
143147
structsockaddr_inin;
148+
#ifndefWIN32
144149
structsockaddr_unun;
150+
#endif
145151
}PGSockAddr;
146152

147153
/* large-object-access data ... allocated only if large-object code is used.

‎src/interfaces/libpq/win32.mak

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ NULL=nul
1111
!ENDIF
1212

1313
CPP=cl.exe
14+
RSC=rc.exe
1415

1516
OUTDIR=.\Release
1617
INTDIR=.\Release
@@ -28,10 +29,14 @@ CLEAN :
2829
-@erase"$(INTDIR)\fe-lobj.obj"
2930
-@erase"$(INTDIR)\fe-misc.obj"
3031
-@erase"$(INTDIR)\fe-print.obj"
31-
-@erase "$(OUTDIR)\libpqdll.obj"
32-
-@erase "$(INTDIR)\vc50.idb"
32+
-@erase"$(OUTDIR)\libpqdll.obj"
3333
-@erase"$(OUTDIR)\libpq.lib"
34-
-@erase "$(OUTDIR)\libpq.dll"
34+
-@erase"$(OUTDIR)\libpq.dll"
35+
-@erase"$(OUTDIR)\libpq.res"
36+
-@erase"vc50.pch"
37+
-@erase"$(OUTDIR)\libpq.pch"
38+
-@erase"$(OUTDIR)\libpqdll.exp"
39+
-@erase"$(OUTDIR)\libpqdll.lib"
3540

3641
"$(OUTDIR)" :
3742
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
@@ -53,6 +58,8 @@ LIB32_OBJS= \
5358
"$(INTDIR)\fe-misc.obj"\
5459
"$(INTDIR)\fe-print.obj"
5560

61+
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\libpq.res"
62+
5663
LINK32=link.exe
5764
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
5865
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib wsock32.lib\
@@ -61,15 +68,20 @@ LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
6168
/implib:"$(OUTDIR)\libpqdll.lib" /def:libpqdll.def
6269
LINK32_OBJS=\
6370
"$(INTDIR)\libpqdll.obj"\
64-
"$(OUTDIR)\libpq.lib"
71+
"$(OUTDIR)\libpq.lib"\
72+
"$(OUTDIR)\libpq.res"
6573

6674

6775
"$(OUTDIR)\libpq.lib" : "$(OUTDIR)"$(DEF_FILE)$(LIB32_OBJS)
6876
$(LIB32) @<<
6977
$(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
7078
<<
7179

72-
"$(OUTDIR)\libpq.dll" : "$(OUTDIR)" "$(OUTDIR)\libpqdll.obj" "$(INTDIR)\libpqdll.obj"
80+
"$(INTDIR)\libpq.res" : "$(INTDIR)" libpq.rc
81+
$(RSC) $(RSC_PROJ) libpq.rc
82+
83+
84+
"$(OUTDIR)\libpq.dll" : "$(OUTDIR)" "$(OUTDIR)\libpqdll.obj" "$(INTDIR)\libpqdll.obj" "$(INTDIR)\libpq.res"
7385
$(LINK32) @<<
7486
$(LINK32_FLAGS) $(LINK32_OBJS)
7587
<<

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp