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

Commitcaad817

Browse files
committed
Add fprintf() custom version to libpgport.
Document use of macros for pg_printf functions.Bump major versions of all interfaces to handle movement of get_prognamefrom libpq to libpgport in 8.0, and probably other libpgport changes in 8.1.
1 parent3bc6bdf commitcaad817

File tree

12 files changed

+64
-26
lines changed

12 files changed

+64
-26
lines changed

‎src/backend/bootstrap/bootscanner.l

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/backend/bootstrap/bootscanner.l,v 1.38 2004/12/31 21:59:34 pgsql Exp $
12+
* $PostgreSQL: pgsql/src/backend/bootstrap/bootscanner.l,v 1.39 2005/03/11 19:13:42 momjian Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -42,6 +42,7 @@
4242

4343

4444
/* Avoid exit() on fatal scanner errors (a bit ugly -- see yy_fatal_error)*/
45+
#undef fprintf
4546
#definefprintf(file, fmt, msg) ereport(ERROR, (errmsg_internal("%s", msg)))
4647

4748

‎src/backend/parser/scan.l

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Portions Copyright (c) 1994, Regents of the University of California
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/parser/scan.l,v 1.120 2005/02/22 04:36:22 momjian Exp $
13+
* $PostgreSQL: pgsql/src/backend/parser/scan.l,v 1.121 2005/03/11 19:13:42 momjian Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -28,6 +28,7 @@
2828

2929

3030
/* Avoid exit() on fatal scanner errors (a bit ugly -- see yy_fatal_error)*/
31+
#undef fprintf
3132
#definefprintf(file, fmt, msg) ereport(ERROR, (errmsg_internal("%s", msg)))
3233

3334
extern YYSTYPE yylval;

‎src/backend/utils/misc/guc-file.l

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
66
*
7-
* $PostgreSQL: pgsql/src/backend/utils/misc/guc-file.l,v 1.29 2005/01/01 05:43:08 momjian Exp $
7+
* $PostgreSQL: pgsql/src/backend/utils/misc/guc-file.l,v 1.30 2005/03/11 19:13:42 momjian Exp $
88
*/
99

1010
%{
@@ -19,6 +19,7 @@
1919
#include"utils/guc.h"
2020

2121
/* Avoid exit() on fatal scanner errors (a bit ugly -- see yy_fatal_error) */
22+
#undef fprintf
2223
#definefprintf(file, fmt, msg) ereport(ERROR, (errmsg_internal("%s", msg)))
2324

2425
staticunsigned ConfigFileLineno;

‎src/include/port.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2005, 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.71 2005/03/1117:20:34 momjian Exp $
9+
* $PostgreSQL: pgsql/src/include/port.h,v 1.72 2005/03/1119:13:42 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -112,17 +112,27 @@ extern int pg_vsnprintf(char *str, size_t count, const char *fmt, va_list args);
112112
externintpg_snprintf(char*str,size_tcount,constchar*fmt,...)
113113
/* This extension allows gcc to check the format string */
114114
__attribute__((format(printf,3,4)));
115+
externintpg_fprintf(FILE*stream,constchar*fmt,...)
116+
/* This extension allows gcc to check the format string */
117+
__attribute__((format(printf,2,3)));
115118
externintpg_printf(constchar*fmt,...)
116119
/* This extension allows gcc to check the format string */
117120
__attribute__((format(printf,1,2)));
118121

122+
/*
123+
*The GCC-specific code below prevents the __attribute__(... 'printf')
124+
*above from being replaced, and this is required because gcc doesn't
125+
*know anything about pg_printf.
126+
*/
119127
#ifdef__GNUC__
120-
#definevsnprintf(...)pg_vsnprintf(__VA_ARGS__)
128+
#definevsnprintf(...)pg_vsnprintf(__VA_ARGS__)
121129
#definesnprintf(...)pg_snprintf(__VA_ARGS__)
130+
#definefprintf(...)pg_fprintf(__VA_ARGS__)
122131
#defineprintf(...)pg_printf(__VA_ARGS__)
123132
#else
124133
#definevsnprintfpg_vsnprintf
125134
#definesnprintfpg_snprintf
135+
#definefprintfpg_fprintf
126136
#defineprintfpg_printf
127137
#endif
128138
#endif

‎src/interfaces/ecpg/compatlib/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/Makefile,v 1.19 2005/01/18 05:00:15 momjian Exp $
7+
# $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/Makefile,v 1.20 2005/03/11 19:13:42 momjian Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -13,8 +13,8 @@ top_builddir = ../../../..
1313
include$(top_builddir)/src/Makefile.global
1414

1515
NAME= ecpg_compat
16-
SO_MAJOR_VERSION=1
17-
SO_MINOR_VERSION=2
16+
SO_MAJOR_VERSION=2
17+
SO_MINOR_VERSION=0
1818
DLTYPE= library
1919

2020
overrideCPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdir)\

‎src/interfaces/ecpg/ecpglib/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/Makefile,v 1.31 2005/01/26 19:24:01 tgl Exp $
7+
# $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/Makefile,v 1.32 2005/03/11 19:13:42 momjian Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -13,8 +13,8 @@ top_builddir = ../../../..
1313
include$(top_builddir)/src/Makefile.global
1414

1515
NAME= ecpg
16-
SO_MAJOR_VERSION=4
17-
SO_MINOR_VERSION=3
16+
SO_MAJOR_VERSION=5
17+
SO_MINOR_VERSION=0
1818
DLTYPE= library
1919

2020
overrideCPPFLAGS := -DFRONTEND -I$(top_srcdir)/src/interfaces/ecpg/include\

‎src/interfaces/ecpg/pgtypeslib/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/Makefile,v 1.24 2005/01/18 05:00:23 momjian Exp $
7+
# $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/Makefile,v 1.25 2005/03/11 19:13:43 momjian Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -13,8 +13,8 @@ top_builddir = ../../../..
1313
include$(top_builddir)/src/Makefile.global
1414

1515
NAME= pgtypes
16-
SO_MAJOR_VERSION=1
17-
SO_MINOR_VERSION=3
16+
SO_MAJOR_VERSION=2
17+
SO_MINOR_VERSION=0
1818
DLTYPE= library
1919

2020
overrideCPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include\

‎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-2005, PostgreSQL Global Development Group
66
#
7-
# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.112 2005/01/25 12:51:31 meskes Exp $
7+
# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.113 2005/03/11 19:13:43 momjian Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -13,8 +13,8 @@ subdir = src/interfaces/ecpg/preproc
1313
top_builddir = ../../../..
1414
include$(top_builddir)/src/Makefile.global
1515

16-
MAJOR_VERSION=3
17-
MINOR_VERSION=2
16+
MAJOR_VERSION= 4
17+
MINOR_VERSION= 0
1818
PATCHLEVEL=1
1919

2020
overrideCPPFLAGS := -I$(srcdir)/../include -I$(srcdir)$(CPPFLAGS)\

‎src/interfaces/libpq/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
66
# Portions Copyright (c) 1994, Regents of the University of California
77
#
8-
# $PostgreSQL: pgsql/src/interfaces/libpq/Makefile,v 1.128 2005/01/26 19:24:02 tgl Exp $
8+
# $PostgreSQL: pgsql/src/interfaces/libpq/Makefile,v 1.129 2005/03/11 19:13:43 momjian Exp $
99
#
1010
#-------------------------------------------------------------------------
1111

@@ -16,8 +16,8 @@ include $(top_builddir)/src/Makefile.global
1616

1717
# shared library parameters
1818
NAME= pq
19-
SO_MAJOR_VERSION=3
20-
SO_MINOR_VERSION=3
19+
SO_MAJOR_VERSION=4
20+
SO_MINOR_VERSION=0
2121
DLTYPE= library
2222

2323
overrideCPPFLAGS := -DFRONTEND -I$(srcdir)$(CPPFLAGS) -I$(top_builddir)/src/port

‎src/pl/plpgsql/src/scan.l

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* procedural language
55
*
66
* IDENTIFICATION
7-
* $PostgreSQL: pgsql/src/pl/plpgsql/src/scan.l,v 1.39 2005/02/22 07:18:24 neilc Exp $
7+
* $PostgreSQL: pgsql/src/pl/plpgsql/src/scan.l,v 1.40 2005/03/11 19:13:43 momjian Exp $
88
*
99
* This software is copyrighted by Jan Wieck - Hamburg.
1010
*
@@ -45,6 +45,7 @@
4545
#defineYY_READ_BUF_SIZE16777216
4646

4747
/* Avoid exit() on fatal scanner errors (a bit ugly -- see yy_fatal_error)*/
48+
#undef fprintf
4849
#definefprintf(file, fmt, msg) ereport(ERROR, (errmsg_internal("%s", msg)))
4950

5051
/* Handles to the buffer that the lexer uses internally*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp