diff options
Diffstat (limited to 'src/include/port.h')
-rw-r--r-- | src/include/port.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/include/port.h b/src/include/port.h index 5a2953ce600..169ee7ac150 100644 --- a/src/include/port.h +++ b/src/include/port.h @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/port.h,v 1.71 2005/03/11 17:20:34 momjian Exp $ + * $PostgreSQL: pgsql/src/include/port.h,v 1.72 2005/03/11 19:13:42 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -112,17 +112,27 @@ extern int pg_vsnprintf(char *str, size_t count, const char *fmt, va_list args); extern int pg_snprintf(char *str, size_t count, const char *fmt,...) /* This extension allows gcc to check the format string */ __attribute__((format(printf, 3, 4))); +extern int pg_fprintf(FILE *stream, const char *fmt,...) +/* This extension allows gcc to check the format string */ +__attribute__((format(printf, 2, 3))); extern int pg_printf(const char *fmt,...) /* This extension allows gcc to check the format string */ __attribute__((format(printf, 1, 2))); +/* + * The GCC-specific code below prevents the __attribute__(... 'printf') + * above from being replaced, and this is required because gcc doesn't + * know anything about pg_printf. + */ #ifdef __GNUC__ -#define vsnprintf(...) pg_vsnprintf(__VA_ARGS__) +#define vsnprintf(...) pg_vsnprintf(__VA_ARGS__) #define snprintf(...) pg_snprintf(__VA_ARGS__) +#define fprintf(...) pg_fprintf(__VA_ARGS__) #define printf(...) pg_printf(__VA_ARGS__) #else #define vsnprintf pg_vsnprintf #define snprintf pg_snprintf +#define fprintf pg_fprintf #define printf pg_printf #endif #endif |