diff options
| author | Noah Misch <noah@leadboat.com> | 2015-05-18 10:02:31 -0400 |
|---|---|---|
| committer | Noah Misch <noah@leadboat.com> | 2015-05-18 10:02:37 -0400 |
| commit | 1e6652aea503b16ea99662832d07241bf47f21f3 (patch) | |
| tree | f08dcf1d647d38200bbbf1aee4516c0eae50f655 /src/include | |
| parent | 439ff9b6b9de435e1c92d05221cfbcb7ff80e150 (diff) | |
Permit use of vsprintf() in PostgreSQL code.
The next commit needs it. Back-patch to 9.0 (all supported versions).
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/port.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/include/port.h b/src/include/port.h index 01fd9cf61dc..a7d3ff85304 100644 --- a/src/include/port.h +++ b/src/include/port.h @@ -169,6 +169,9 @@ extern unsigned char pg_ascii_tolower(unsigned char ch); #ifdef snprintf #undef snprintf #endif +#ifdef vsprintf +#undef vsprintf +#endif #ifdef sprintf #undef sprintf #endif @@ -187,6 +190,7 @@ extern int pg_snprintf(char *str, size_t count, const char *fmt,...) /* This extension allows gcc to check the format string */ __attribute__((format(PG_PRINTF_ATTRIBUTE, 3, 4))); +extern int pg_vsprintf(char *str, const char *fmt, va_list args); extern int pg_sprintf(char *str, const char *fmt,...) /* This extension allows gcc to check the format string */ @@ -209,6 +213,7 @@ __attribute__((format(PG_PRINTF_ATTRIBUTE, 1, 2))); #ifdef __GNUC__ #define vsnprintf(...) pg_vsnprintf(__VA_ARGS__) #define snprintf(...) pg_snprintf(__VA_ARGS__) +#define vsprintf(...) pg_vsprintf(__VA_ARGS__) #define sprintf(...) pg_sprintf(__VA_ARGS__) #define vfprintf(...) pg_vfprintf(__VA_ARGS__) #define fprintf(...) pg_fprintf(__VA_ARGS__) @@ -216,6 +221,7 @@ __attribute__((format(PG_PRINTF_ATTRIBUTE, 1, 2))); #else #define vsnprintf pg_vsnprintf #define snprintf pg_snprintf +#define vsprintf pg_vsprintf #define sprintf pg_sprintf #define vfprintf pg_vfprintf #define fprintf pg_fprintf |
