summaryrefslogtreecommitdiff
path: root/lib/zebra.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/zebra.h')
-rw-r--r--lib/zebra.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/zebra.h b/lib/zebra.h
index 8c2dcaba..887ff7d6 100644
--- a/lib/zebra.h
+++ b/lib/zebra.h
@@ -97,9 +97,17 @@ typedef int socklen_t;
#include <stdarg.h>
#if !(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
/* Not C99; do we need to define va_copy? */
-#if !defined(va_copy) && defined(__va_copy)
+#ifndef va_copy
+#ifdef __va_copy
#define va_copy(DST,SRC) __va_copy(DST,SRC)
-#endif /* need va_copy */
+#else
+/* Now we are desperate; this should work on many typical platforms.
+ But this is slightly dangerous, because the standard does not require
+ va_copy to be a macro. */
+#define va_copy(DST,SRC) memcpy(&(DST), &(SRC), sizeof(va_list))
+#warning "Not C99 and no va_copy macro available, falling back to memcpy"
+#endif /* __va_copy */
+#endif /* !va_copy */
#endif /* !C99 */
#include "zassert.h"