diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 1999-01-17 03:22:52 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 1999-01-17 03:22:52 +0000 |
commit | 7fab608205e7a29b2a9bcd344e409edbb4cea6e3 (patch) | |
tree | e0bcefb8166f240cc23212f418057deee6853784 /src/include/c.h | |
parent | cd6bc85aa2f847d49660d2d09c97c72d2bbe1ef1 (diff) | |
download | postgresql-7fab608205e7a29b2a9bcd344e409edbb4cea6e3.tar.gz postgresql-7fab608205e7a29b2a9bcd344e409edbb4cea6e3.zip |
Add configure test to see whether vsnprintf() is present,
separately from snprintf() --- HPUX, for one, has snprintf but not
vsnprintf. Fix a minor typo in snprintf.c, too.
Diffstat (limited to 'src/include/c.h')
-rw-r--r-- | src/include/c.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/include/c.h b/src/include/c.h index cd7ecb9de24..0432d819406 100644 --- a/src/include/c.h +++ b/src/include/c.h @@ -7,7 +7,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: c.h,v 1.47 1998/12/13 03:44:38 momjian Exp $ + * $Id: c.h,v 1.48 1999/01/17 03:22:51 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -45,9 +45,13 @@ /* We have to include stdlib.h here because it defines many of these macros on some platforms, and we only want our definitions used if stdlib.h doesn't - have its own. + have its own. The same goes for stddef and stdarg if present. */ #include <stdlib.h> +#ifdef STDC_HEADERS +#include <stddef.h> +#include <stdarg.h> +#endif /* ---------------------------------------------------------------- * Section 1: bool, true, false, TRUE, FALSE @@ -820,6 +824,19 @@ extern char *form(const char *fmt,...); #define COPY_CMD "cp" #define SEP_CHAR '/' +/* Provide prototypes for routines not present in a particular machine's + * standard C library. It'd be better to put these in config.h, but + * in config.h we haven't yet included anything that defines size_t... + */ + +#ifndef HAVE_SNPRINTF +extern int snprintf(char *str, size_t count, const char *fmt, ...); +#endif + +#ifndef HAVE_VSNPRINTF +extern int vsnprintf(char *str, size_t count, const char *fmt, va_list args); +#endif + /* ---------------- * end of c.h * ---------------- |