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

Commitb544dcd

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

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
@@ -168,6 +168,9 @@ extern unsigned char pg_ascii_tolower(unsigned char ch);
168168
#ifdefsnprintf
169169
#undef snprintf
170170
#endif
171+
#ifdefvsprintf
172+
#undef vsprintf
173+
#endif
171174
#ifdefsprintf
172175
#undef sprintf
173176
#endif
@@ -186,6 +189,7 @@ extern int
186189
pg_snprintf(char*str,size_tcount,constchar*fmt,...)
187190
/* This extension allows gcc to check the format string */
188191
__attribute__((format(PG_PRINTF_ATTRIBUTE,3,4)));
192+
externintpg_vsprintf(char*str,constchar*fmt,va_listargs);
189193
externint
190194
pg_sprintf(char*str,constchar*fmt,...)
191195
/* This extension allows gcc to check the format string */
@@ -208,13 +212,15 @@ __attribute__((format(PG_PRINTF_ATTRIBUTE, 1, 2)));
208212
#ifdef__GNUC__
209213
#definevsnprintf(...)pg_vsnprintf(__VA_ARGS__)
210214
#definesnprintf(...)pg_snprintf(__VA_ARGS__)
215+
#definevsprintf(...)pg_vsprintf(__VA_ARGS__)
211216
#definesprintf(...)pg_sprintf(__VA_ARGS__)
212217
#definevfprintf(...)pg_vfprintf(__VA_ARGS__)
213218
#definefprintf(...)pg_fprintf(__VA_ARGS__)
214219
#defineprintf(...)pg_printf(__VA_ARGS__)
215220
#else
216221
#definevsnprintfpg_vsnprintf
217222
#definesnprintfpg_snprintf
223+
#definevsprintfpg_vsprintf
218224
#definesprintfpg_sprintf
219225
#definevfprintfpg_vfprintf
220226
#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