Skip to content

Commit d82e7c8

Browse files
author
Michael Meskes
committed
Link in keywords file instead of copying it.
Use #define/#ifdef instead of sed to fix include files, this should work on Windows too.
1 parent 42ad663 commit d82e7c8

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

src/backend/parser/keywords.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $PostgreSQL: pgsql/src/backend/parser/keywords.c,v 1.196 2008/05/16 23:36:05 tgl Exp $
14+
* $PostgreSQL: pgsql/src/backend/parser/keywords.c,v 1.197 2008/05/21 19:51:01 meskes Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -29,8 +29,11 @@
2929
#define YYSTYPE int
3030

3131
#include "parser/keywords.h"
32+
#ifndef ECPG_COMPILE
3233
#include "parser/parse.h"
33-
34+
#else
35+
#include "preproc.h"
36+
#endif
3437

3538
/*
3639
* List of keyword (name, token-value, category) entries.

src/interfaces/ecpg/preproc/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1998-2008, PostgreSQL Global Development Group
66
#
7-
# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.134 2008/05/21 00:26:26 meskes Exp $
7+
# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.135 2008/05/21 19:51:01 meskes Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -22,7 +22,7 @@ override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
2222
-DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \
2323
$(CPPFLAGS)
2424

25-
override CFLAGS += $(PTHREAD_CFLAGS)
25+
override CFLAGS += $(PTHREAD_CFLAGS) -DECPG_COMPILE
2626

2727
OBJS= preproc.o type.o ecpg.o output.o parser.o \
2828
keywords.o c_keywords.o ecpg_keywords.o ../ecpglib/typename.o descriptor.o variable.o \
@@ -59,7 +59,7 @@ ecpg_keywords.o c_keywords.o keywords.o preproc.o parser.o: preproc.h
5959
# instead of maintaining our own list, take the one from the backend
6060
# we cannot just link it in, but must copy and make some minor changes
6161
keywords.c: % : $(top_srcdir)/src/backend/parser/%
62-
sed -e 's/#include "parser\/parse.h"/#include "preproc.h"/' $< > $@
62+
rm -f $@ && $(LN_S) $< .
6363

6464
distprep: $(srcdir)/preproc.c $(srcdir)/preproc.h $(srcdir)/pgc.c
6565

src/tools/msvc/Mkvcbuild.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package Mkvcbuild;
33
#
44
# Package that generates build files for msvc build
55
#
6-
# $PostgreSQL: pgsql/src/tools/msvc/Mkvcbuild.pm,v 1.30 2008/05/21 18:15:29 mha Exp $
6+
# $PostgreSQL: pgsql/src/tools/msvc/Mkvcbuild.pm,v 1.31 2008/05/21 19:51:01 meskes Exp $
77
#
88
use Carp;
99
use Win32;
@@ -162,12 +162,12 @@ sub mkvcbuild
162162
my $ecpg = $solution->AddProject('ecpg','exe','interfaces','src\interfaces\ecpg\preproc');
163163
$ecpg->AddIncludeDir('src\interfaces\ecpg\include');
164164
$ecpg->AddIncludeDir('src\interfaces\libpq');
165-
$ecpg->AddIncludeDir('src\backend'); # needed for parse.h
166165
$ecpg->AddPrefixInclude('src\interfaces\ecpg\preproc');
167166
$ecpg->AddFiles('src\interfaces\ecpg\preproc','pgc.l','preproc.y');
168167
$ecpg->AddDefine('MAJOR_VERSION=4');
169168
$ecpg->AddDefine('MINOR_VERSION=2');
170169
$ecpg->AddDefine('PATCHLEVEL=1');
170+
$ecpg->AddDefine('ECPG_COMPILE');
171171
$ecpg->AddReference($libpgport);
172172

173173
my $pgregress_ecpg = $solution->AddProject('pg_regress_ecpg','exe','misc');

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy