]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Portability: add cstdarg as source of var_arg when available
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 6 Nov 2011 07:16:18 +0000 (01:16 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 6 Nov 2011 07:16:18 +0000 (01:16 -0600)
compat/stdvarargs.h
configure.ac

index c38a2cf2c9a84126471195f0886ff875f7f5dbdc..8997d9a3615f63de034588cae30a0e28ec634eb7 100644 (file)
@@ -7,28 +7,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 */
 #ifdef HAVE_SYSLOG_H
index 1fa14d4091dddb22a73b44dd8d9414799f88f8b4..980e73290d5ea72321086157e6a46d6aa50f6b88 100644 (file)
@@ -2279,6 +2279,7 @@ AC_CHECK_HEADERS( \
        bstring.h \
        cassert \
        crypt.h \
+       cstdarg \
        cstring \
        ctype.h \
        errno.h \