Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f6b896b

Browse files
committed
Improve MS VC builds for psql by handlling flex properly and prevent
rename prototype conflict.
1 parent a6cb7fd commit f6b896b

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

src/bin/psql/bcc32.mak

+5-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ NULL=nul
3737

3838
CPP=bcc32.exe
3939
PERL=perl.exe
40+
FLEX=flex.exe
4041

4142
!IF "$(CFG)" == "Debug"
4243
DEBUG=1
@@ -53,7 +54,7 @@ REFDOCDIR=../../../doc/src/sgml/ref
5354
.c.obj:
5455
$(CPP) -o"$(INTDIR)\$&" $(CPP_PROJ) $<
5556

56-
ALL : sql_help.h "..\..\port\pg_config_paths.h" "$(OUTDIR)\psql.exe"
57+
ALL : sql_help.h psqlscan.c "..\..\port\pg_config_paths.h" "$(OUTDIR)\psql.exe"
5758

5859
CLEAN :
5960
-@erase "$(INTDIR)\command.obj"
@@ -158,3 +159,6 @@ path.obj : "$(OUTDIR)" ..\..\port\path.c
158159

159160
"sql_help.h": create_help.pl
160161
$(PERL) create_help.pl $(REFDOCDIR) $@
162+
163+
psqlscan.c : psqlscan.l
164+
$(FLEX) -Cfe -opsqlscan.c psqlscan.l

src/bin/psql/win32.mak

+6-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ NULL=nul
88

99
CPP=cl.exe
1010
PERL=perl.exe
11+
FLEX=flex.exe
1112

1213
OUTDIR=.\Release
1314
INTDIR=.\Release
@@ -16,7 +17,7 @@ REFDOCDIR= ../../../doc/src/sgml/ref
1617
OutDir=.\Release
1718
# End Custom Macros
1819

19-
ALL : sql_help.h "..\..\port\pg_config_paths.h" "$(OUTDIR)\psql.exe"
20+
ALL : sql_help.h psqlscan.c "..\..\port\pg_config_paths.h" "$(OUTDIR)\psql.exe"
2021

2122
CLEAN :
2223
-@erase "$(INTDIR)\command.obj"
@@ -127,5 +128,8 @@ LINK32_OBJS= \
127128
$(CPP_PROJ) $<
128129
<<
129130

130-
sql_help.h: create_help.pl
131+
sql_help.h : create_help.pl
131132
$(PERL) create_help.pl $(REFDOCDIR) $@
133+
134+
psqlscan.c: psqlscan.l
135+
$(FLEX) -Cfe -opsqlscan.c psqlscan.l

src/include/port.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
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.61 2004/09/09 14:18:20 momjian Exp $
9+
* $PostgreSQL: pgsql/src/include/port.h,v 1.62 2004/09/27 20:37:20 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -168,6 +168,11 @@ extern int pgrename(const char *from, const char *to);
168168
extern int pgunlink(const char *path);
169169
extern int pgsymlink(const char *oldpath, const char *newpath);
170170

171+
/* Include this first so later includes don't see these defines */
172+
#ifdef _MSC_VER
173+
#include <io.h>
174+
#endif
175+
171176
#define rename(from, to) pgrename(from, to)
172177
#define unlink(path) pgunlink(path)
173178
#define symlink(oldpath, newpath) pgsymlink(oldpath, newpath)

0 commit comments

Comments
 (0)