Skip to content

Commit a7b5573

Browse files
committed
Remove separate version numbering for ecpg preprocessor.
Once upon a time, it made sense for the ecpg preprocessor to have its own version number, because it used a manually-maintained grammar that wasn't always in sync with the core grammar. But those days are thankfully long gone, leaving only a maintenance nuisance behind. Let's use the PG v10 version numbering changeover as an excuse to get rid of the ecpg version number and just have ecpg identify itself by PG_VERSION. From the user's standpoint, ecpg will go from "4.12" in the 9.6 branch to "10" in the 10 branch, so there's no failure of monotonicity. Discussion: <1471332659.4410.67.camel@postgresql.org>
1 parent 9b002cc commit a7b5573

File tree

4 files changed

+8
-18
lines changed

4 files changed

+8
-18
lines changed

src/interfaces/ecpg/preproc/Makefile

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,11 @@ subdir = src/interfaces/ecpg/preproc
1515
top_builddir = ../../../..
1616
include $(top_builddir)/src/Makefile.global
1717

18-
MAJOR_VERSION= 4
19-
MINOR_VERSION= 13
20-
PATCHLEVEL=0
21-
2218
override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
23-
-I. -I$(srcdir) -DMAJOR_VERSION=$(MAJOR_VERSION) \
24-
-DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \
19+
-I. -I$(srcdir) -DECPG_COMPILE \
2520
$(CPPFLAGS)
2621

27-
override CFLAGS += $(PTHREAD_CFLAGS) -DECPG_COMPILE
22+
override CFLAGS += $(PTHREAD_CFLAGS)
2823

2924
OBJS= preproc.o pgc.o type.o ecpg.o output.o parser.o \
3025
keywords.o c_keywords.o ecpg_keywords.o ../ecpglib/typename.o descriptor.o variable.o \

src/interfaces/ecpg/preproc/ecpg.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,7 @@ main(int argc, char *const argv[])
150150
switch (c)
151151
{
152152
case ECPG_GETOPT_LONG_VERSION:
153-
printf("ecpg (PostgreSQL %s) %d.%d.%d\n", PG_VERSION,
154-
MAJOR_VERSION, MINOR_VERSION, PATCHLEVEL);
153+
printf("ecpg %s\n", PG_VERSION);
155154
exit(0);
156155
case ECPG_GETOPT_LONG_HELP:
157156
help(progname);
@@ -264,8 +263,9 @@ main(int argc, char *const argv[])
264263

265264
if (verbose)
266265
{
267-
fprintf(stderr, _("%s, the PostgreSQL embedded C preprocessor, version %d.%d.%d\n"),
268-
progname, MAJOR_VERSION, MINOR_VERSION, PATCHLEVEL);
266+
fprintf(stderr,
267+
_("%s, the PostgreSQL embedded C preprocessor, version %s\n"),
268+
progname, PG_VERSION);
269269
fprintf(stderr, _("EXEC SQL INCLUDE ... search starts here:\n"));
270270
for (ip = include_paths; ip != NULL; ip = ip->next)
271271
fprintf(stderr, " %s\n", ip->path);
@@ -440,7 +440,7 @@ main(int argc, char *const argv[])
440440
if (regression_mode)
441441
fprintf(yyout, "/* Processed by ecpg (regression mode) */\n");
442442
else
443-
fprintf(yyout, "/* Processed by ecpg (%d.%d.%d) */\n", MAJOR_VERSION, MINOR_VERSION, PATCHLEVEL);
443+
fprintf(yyout, "/* Processed by ecpg (%s) */\n", PG_VERSION);
444444

445445
if (header_mode == false)
446446
{

src/tools/RELEASE_CHANGES

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,11 @@ Starting a New Development Cycle
8080
* Add version tag to src/tools/git_changelog
8181

8282
* Bump minor library versions, major if appropriate (see below)
83-
o Look for SO_MINOR_VERSION and MINOR_VERSION macros in
83+
o Look for SO_MINOR_VERSION macros in
8484
src/interfaces/ecpg/compatlib/Makefile
8585
src/interfaces/ecpg/ecpglib/Makefile
8686
src/interfaces/ecpg/pgtypeslib/Makefile
87-
src/interfaces/ecpg/preproc/Makefile
8887
src/interfaces/libpq/Makefile
89-
src/tools/msvc/Mkvcbuild.pm
9088

9189

9290
Creating Back-Branch Release Notes

src/tools/msvc/Mkvcbuild.pm

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,6 @@ sub mkvcbuild
269269
$ecpg->AddIncludeDir('src/interfaces/libpq');
270270
$ecpg->AddPrefixInclude('src/interfaces/ecpg/preproc');
271271
$ecpg->AddFiles('src/interfaces/ecpg/preproc', 'pgc.l', 'preproc.y');
272-
$ecpg->AddDefine('MAJOR_VERSION=4');
273-
$ecpg->AddDefine('MINOR_VERSION=13');
274-
$ecpg->AddDefine('PATCHLEVEL=0');
275272
$ecpg->AddDefine('ECPG_COMPILE');
276273
$ecpg->AddReference($libpgcommon, $libpgport);
277274

0 commit comments

Comments
 (0)