Prevent compiler warnings with 9.0

PG_PRINTF_ATTRIBUTE was introduced with 9.1.
This commit is contained in:
Ian Barwick
2015-04-14 20:21:54 +09:00
parent 196585c78a
commit e39ec70ef0
3 changed files with 26 additions and 0 deletions

View File

@@ -25,9 +25,15 @@
#include "log.h"
#include "strutil.h"
#if (PG_VERSION_NUM >= 90100)
static int
xvsnprintf(char *str, size_t size, const char *format, va_list ap)
__attribute__((format(PG_PRINTF_ATTRIBUTE, 3, 0)));
#else
static int
xvsnprintf(char *str, size_t size, const char *format, va_list ap)
__attribute__((format(printf, 3, 0)));
#endif
static int
xvsnprintf(char *str, size_t size, const char *format, va_list ap)