From: Amos Jeffries Date: Sun, 6 Nov 2011 07:16:18 +0000 (-0600) Subject: Portability: add cstdarg as source of var_arg when available X-Git-Tag: SQUID_3_1_17~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49217c2ec9cd262ac599ae8f5df861c8a02d9f08;p=thirdparty%2Fsquid.git Portability: add cstdarg as source of var_arg when available --- diff --git a/compat/stdvarargs.h b/compat/stdvarargs.h index c38a2cf2c9..8997d9a361 100644 --- a/compat/stdvarargs.h +++ b/compat/stdvarargs.h @@ -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 + +#else +#if HAVE_STDARG_H #include #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 #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 diff --git a/configure.ac b/configure.ac index 1fa14d4091..980e73290d 100644 --- a/configure.ac +++ b/configure.ac @@ -2279,6 +2279,7 @@ AC_CHECK_HEADERS( \ bstring.h \ cassert \ crypt.h \ + cstdarg \ cstring \ ctype.h \ errno.h \