/*
* va_* variables come from various places on different platforms.
- * We provide a clean set of wrappers for the variosu operations
+ * We provide a clean set of wrappers for the various operations
* Depending on what is available and needed.
*/
-#if defined(HAVE_STDARG_H)
+#if HAVE_CSTDARG && defined(__cplusplus)
+#include <cstdarg>
+
+#else
+#if HAVE_STDARG_H
#include <stdarg.h>
#define HAVE_STDARGS /* let's hope that works everywhere (mj) */
#define VA_LOCAL_DECL va_list ap;
#define VA_START(f) va_start(ap, f)
#define VA_SHIFT(v,t) ; /* no-op for ANSI */
#define VA_END va_end(ap)
+
#else
-#if defined(HAVE_VARARGS_H)
+#if HAVE_VARARGS_H
#include <varargs.h>
#undef HAVE_STDARGS
#define VA_LOCAL_DECL va_list ap;
#define VA_START(f) va_start(ap) /* f is ignored! */
#define VA_SHIFT(v,t) v = va_arg(ap,t)
#define VA_END va_end(ap)
+
#else
#error XX **NO VARARGS ** XX
-#endif
-#endif
+#endif /* HAVE_VARARGS_H */
+#endif /* HAVE_STDARG_H */
+#endif /* HAVE_CSTDARG */
/* Make sure syslog goes after stdarg/varargs */
#ifdef HAVE_SYSLOG_H