From 702ec173ded59dc5cb98a348da4624aa9e4e3d5a Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 11 Nov 2013 14:35:10 -0700 Subject: [PATCH] Move va_copy compat macro to missing.h --- include/missing.h | 11 +++++++++++ plugins/sudoers/logging.c | 4 ---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/include/missing.h b/include/missing.h index c72f40d5e..8cdea34d0 100644 --- a/include/missing.h +++ b/include/missing.h @@ -99,6 +99,17 @@ # endif #endif +/* + * Pre-C99 compilers may lack a va_copy macro. + */ +#ifndef va_copy +# ifdef __va_copy +# define va_copy(d, s) __va_copy(d, s) +# else +# define va_copy(d, s) memcpy(&(d), &(s), sizeof(d)); +# endif +#endif + /* * Some systems lack full limit definitions. */ diff --git a/plugins/sudoers/logging.c b/plugins/sudoers/logging.c index 449eaee37..4cd4398f5 100644 --- a/plugins/sudoers/logging.c +++ b/plugins/sudoers/logging.c @@ -59,10 +59,6 @@ #include "sudoers.h" -#ifndef va_copy -# define va_copy(d, s) memcpy(&(d), &(s), sizeof(d)); -#endif - /* Special message for log_warning() so we know to use ngettext() */ #define INCORRECT_PASSWORD_ATTEMPT ((char *)0x01)