summaryrefslogtreecommitdiff
path: root/make.h
diff options
context:
space:
mode:
Diffstat (limited to 'make.h')
-rw-r--r--make.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/make.h b/make.h
index 3fae1bf..fcd0e75 100644
--- a/make.h
+++ b/make.h
@@ -388,7 +388,29 @@ struct floc
/* Fancy processing for variadic functions in both ANSI and pre-ANSI
compilers. */
-#if defined __STDC__ && __STDC__
+#if HAVE_STDARG_H
+# include <stdarg.h>
+# define VA_START(a, f) va_start(a, f)
+#else
+# if HAVE_VARARGS_H
+# include <varargs.h>
+# define VA_START(a, f) va_start(a)
+# endif
+#endif
+#ifndef VA_START
+ error no variadic api
+#endif
+
+/* We have to have both stdarg.h or varargs.h AND v*printf or doprnt to use
+ variadic versions of these functions. */
+
+#if HAVE_STDARG_H || HAVE_VARARGS_H
+# if HAVE_VPRINTF || HAVE_DOPRNT
+# define USE_VARIADIC 1
+# endif
+#endif
+
+#if __STDC__ && USE_VARIADIC
extern void message (int prefix, const char *fmt, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
extern void error (const struct floc *flocp, const char *fmt, ...)