aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/c.h21
-rw-r--r--src/include/config.h.in3
-rw-r--r--src/include/port/hpux.h8
3 files changed, 30 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
* ----------------
diff --git a/src/include/config.h.in b/src/include/config.h.in
index 3a54c89c1ff..3ab45d0a73e 100644
--- a/src/include/config.h.in
+++ b/src/include/config.h.in
@@ -118,6 +118,9 @@
/* Set to 1 if you have snprintf() */
#undef HAVE_SNPRINTF
+/* Set to 1 if you have vsnprintf() */
+#undef HAVE_VSNPRINTF
+
/* Set to 1 if you have fp_class() */
#undef HAVE_FP_CLASS
diff --git a/src/include/port/hpux.h b/src/include/port/hpux.h
index 4ef01af0958..0c42e6c4b76 100644
--- a/src/include/port/hpux.h
+++ b/src/include/port/hpux.h
@@ -6,6 +6,14 @@ typedef struct
int sema[4];
} slock_t;
+/* HPUX 9 has snprintf in the library, so configure will set HAVE_SNPRINTF;
+ * but it doesn't provide a prototype for it. To suppress warning messages
+ * from gcc, do this to make c.h provide the prototype:
+ */
+#ifndef HAVE_VSNPRINTF
+#undef HAVE_SNPRINTF
+#endif
+
#ifndef BIG_ENDIAN
#define BIG_ENDIAN 4321
#endif