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

Commit19f7adc

Browse files
committed
Permit use of vsprintf() in PostgreSQL code.
The next commit needs it. Back-patch to 9.0 (all supported versions).
1 parent648e41a commit19f7adc

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

‎src/include/port.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ extern unsigned char pg_tolower(unsigned char ch);
161161
#ifdefsnprintf
162162
#undef snprintf
163163
#endif
164+
#ifdefvsprintf
165+
#undef vsprintf
166+
#endif
164167
#ifdefsprintf
165168
#undef sprintf
166169
#endif
@@ -179,6 +182,7 @@ extern int
179182
pg_snprintf(char*str,size_tcount,constchar*fmt,...)
180183
/* This extension allows gcc to check the format string */
181184
__attribute__((format(printf,3,4)));
185+
externintpg_vsprintf(char*str,constchar*fmt,va_listargs);
182186
externint
183187
pg_sprintf(char*str,constchar*fmt,...)
184188
/* This extension allows gcc to check the format string */
@@ -201,13 +205,15 @@ __attribute__((format(printf, 1, 2)));
201205
#ifdef__GNUC__
202206
#definevsnprintf(...)pg_vsnprintf(__VA_ARGS__)
203207
#definesnprintf(...)pg_snprintf(__VA_ARGS__)
208+
#definevsprintf(...)pg_vsprintf(__VA_ARGS__)
204209
#definesprintf(...)pg_sprintf(__VA_ARGS__)
205210
#definevfprintf(...)pg_vfprintf(__VA_ARGS__)
206211
#definefprintf(...)pg_fprintf(__VA_ARGS__)
207212
#defineprintf(...)pg_printf(__VA_ARGS__)
208213
#else
209214
#definevsnprintfpg_vsnprintf
210215
#definesnprintfpg_snprintf
216+
#definevsprintfpg_vsprintf
211217
#definesprintfpg_sprintf
212218
#definevfprintfpg_vfprintf
213219
#definefprintfpg_fprintf

‎src/port/snprintf.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
/* Prevent recursion */
100100
#undefvsnprintf
101101
#undefsnprintf
102+
#undefvsprintf
102103
#undefsprintf
103104
#undefvfprintf
104105
#undeffprintf
@@ -178,7 +179,7 @@ pg_snprintf(char *str, size_t count, const char *fmt,...)
178179
returnlen;
179180
}
180181

181-
staticint
182+
int
182183
pg_vsprintf(char*str,constchar*fmt,va_listargs)
183184
{
184185
PrintfTargettarget;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp