]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Portability: add cstdarg as source of var_arg when available
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 4 Nov 2011 07:03:11 +0000 (20:03 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 4 Nov 2011 07:03:11 +0000 (20:03 +1300)
compat/stdvarargs.h
configure.ac

index 60b5bad990c4b21d9f2c1f2350e5c98f5e4f48b7..dc8f6c182b8d8b3e009778af19f00a46969ea939 100644 (file)
@@ -3,28 +3,35 @@
 
 /*
  * 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 */
 #if HAVE_SYSLOG_H
index f639126b01f89936313cec220f39b8b96e283f6e..97d4ab2652230ec813adf55778affd813810b133 100644 (file)
@@ -2294,6 +2294,7 @@ AC_CHECK_HEADERS( \
   bstring.h \
   cassert \
   crypt.h \
+  cstdarg \
   cstdlib \
   cstring \
   list \