Add configure check for va_copy instead of using #ifdef

This prevents the va_copy compat #define from being used if
sudo_compat.h is somehow included before stdarg.h.
This commit is contained in:
Todd C. Miller
2021-07-25 15:51:23 -06:00
parent b0ae7a566b
commit 4a90deb2a0
4 changed files with 105 additions and 2 deletions

View File

@@ -91,8 +91,8 @@
/*
* Pre-C99 compilers may lack a va_copy macro.
*/
#ifndef va_copy
# ifdef __va_copy
#ifndef HAVE_VA_COPY
# ifdef HAVE___VA_COPY
# define va_copy(d, s) __va_copy(d, s)
# else
# define va_copy(d, s) memcpy(&(d), &(s), sizeof(d));