|
6 | 6 | * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group |
7 | 7 | * Portions Copyright (c) 1994, Regents of the University of California |
8 | 8 | * |
9 | | - * $PostgreSQL: pgsql/src/include/port.h,v 1.71 2005/03/11 17:20:34 momjian Exp $ |
| 9 | + * $PostgreSQL: pgsql/src/include/port.h,v 1.72 2005/03/11 19:13:42 momjian Exp $ |
10 | 10 | * |
11 | 11 | *------------------------------------------------------------------------- |
12 | 12 | */ |
@@ -112,17 +112,27 @@ extern int pg_vsnprintf(char *str, size_t count, const char *fmt, va_list args); |
112 | 112 | extern int pg_snprintf(char *str, size_t count, const char *fmt,...) |
113 | 113 | /* This extension allows gcc to check the format string */ |
114 | 114 | __attribute__((format(printf, 3, 4))); |
| 115 | +extern int pg_fprintf(FILE *stream, const char *fmt,...) |
| 116 | +/* This extension allows gcc to check the format string */ |
| 117 | +__attribute__((format(printf, 2, 3))); |
115 | 118 | extern int pg_printf(const char *fmt,...) |
116 | 119 | /* This extension allows gcc to check the format string */ |
117 | 120 | __attribute__((format(printf, 1, 2))); |
118 | 121 |
|
| 122 | +/* |
| 123 | + * The GCC-specific code below prevents the __attribute__(... 'printf') |
| 124 | + * above from being replaced, and this is required because gcc doesn't |
| 125 | + * know anything about pg_printf. |
| 126 | + */ |
119 | 127 | #ifdef __GNUC__ |
120 | | -#define vsnprintf(...) pg_vsnprintf(__VA_ARGS__) |
| 128 | +#define vsnprintf(...) pg_vsnprintf(__VA_ARGS__) |
121 | 129 | #define snprintf(...) pg_snprintf(__VA_ARGS__) |
| 130 | +#define fprintf(...) pg_fprintf(__VA_ARGS__) |
122 | 131 | #define printf(...) pg_printf(__VA_ARGS__) |
123 | 132 | #else |
124 | 133 | #define vsnprintf pg_vsnprintf |
125 | 134 | #define snprintf pg_snprintf |
| 135 | +#define fprintf pg_fprintf |
126 | 136 | #define printf pg_printf |
127 | 137 | #endif |
128 | 138 | #endif |
|
0 commit comments