diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-12-06 02:29:27 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-12-06 02:29:27 +0000 |
commit | f244c488fb7312933c24cae816bc4ce470d27840 (patch) | |
tree | dce1202b5d5f089a95b5e2418719b5aaad4a9828 /src/include/port.h | |
parent | dc68b9ec305fdf831b98a1d80b09753939fa4c59 (diff) |
Make Win32 build use our port/snprintf.c routines, instead of depending
on libintl which may or may not provide what we need. Make a few marginal
cleanups to ensure this works. Andrew Dunstan and Tom Lane.
Diffstat (limited to 'src/include/port.h')
-rw-r--r-- | src/include/port.h | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/src/include/port.h b/src/include/port.h index a61abe719fa..bba92d44811 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.84 2005/10/15 02:49:41 momjian Exp $ + * $PostgreSQL: pgsql/src/include/port.h,v 1.84.2.1 2005/12/06 02:29:26 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -112,7 +112,8 @@ extern int pg_strncasecmp(const char *s1, const char *s2, size_t n); extern unsigned char pg_toupper(unsigned char ch); extern unsigned char pg_tolower(unsigned char ch); -#ifdef USE_SNPRINTF +#ifdef USE_REPL_SNPRINTF + 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,...) @@ -132,6 +133,26 @@ pg_printf(const char *fmt,...) __attribute__((format(printf, 1, 2))); /* + * Some versions of libintl try to replace printf and friends with macros; + * if we are doing likewise, make sure our versions win. + */ +#ifdef vsnprintf +#undef vsnprintf +#endif +#ifdef snprintf +#undef snprintf +#endif +#ifdef sprintf +#undef sprintf +#endif +#ifdef fprintf +#undef fprintf +#endif +#ifdef printf +#undef printf +#endif + +/* * 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. @@ -149,7 +170,8 @@ __attribute__((format(printf, 1, 2))); #define fprintf pg_fprintf #define printf pg_printf #endif -#endif + +#endif /* USE_REPL_SNPRINTF */ /* Portable prompt handling */ extern char *simple_prompt(const char *prompt, int maxlen, bool echo); |