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

Commit1e6652a

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

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
@@ -169,6 +169,9 @@ extern unsigned char pg_ascii_tolower(unsigned char ch);
169169
#ifdefsnprintf
170170
#undef snprintf
171171
#endif
172+
#ifdefvsprintf
173+
#undef vsprintf
174+
#endif
172175
#ifdefsprintf
173176
#undef sprintf
174177
#endif
@@ -187,6 +190,7 @@ extern int
187190
pg_snprintf(char*str,size_tcount,constchar*fmt,...)
188191
/* This extension allows gcc to check the format string */
189192
__attribute__((format(PG_PRINTF_ATTRIBUTE,3,4)));
193+
externintpg_vsprintf(char*str,constchar*fmt,va_listargs);
190194
externint
191195
pg_sprintf(char*str,constchar*fmt,...)
192196
/* This extension allows gcc to check the format string */
@@ -209,13 +213,15 @@ __attribute__((format(PG_PRINTF_ATTRIBUTE, 1, 2)));
209213
#ifdef__GNUC__
210214
#definevsnprintf(...)pg_vsnprintf(__VA_ARGS__)
211215
#definesnprintf(...)pg_snprintf(__VA_ARGS__)
216+
#definevsprintf(...)pg_vsprintf(__VA_ARGS__)
212217
#definesprintf(...)pg_sprintf(__VA_ARGS__)
213218
#definevfprintf(...)pg_vfprintf(__VA_ARGS__)
214219
#definefprintf(...)pg_fprintf(__VA_ARGS__)
215220
#defineprintf(...)pg_printf(__VA_ARGS__)
216221
#else
217222
#definevsnprintfpg_vsnprintf
218223
#definesnprintfpg_snprintf
224+
#definevsprintfpg_vsprintf
219225
#definesprintfpg_sprintf
220226
#definevfprintfpg_vfprintf
221227
#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