diff options
author | ajs <ajs> | 2005-01-12 16:18:17 +0000 |
---|---|---|
committer | ajs <ajs> | 2005-01-12 16:18:17 +0000 |
commit | e22f5516b3e1431b7716632b76e257b84e7e0ff4 (patch) | |
tree | 16ee1046948d1b8099c476a2450bdd605eca03e5 | |
parent | afc1e2ddf29fffe996f44d0f8eca99522e75d0ba (diff) |
2005-01-12 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* zebra.h: If not C99 and no va_copy macro available, fall back to
memcpy (solves a build problem on FreeBSD 4.x).
-rw-r--r-- | lib/ChangeLog | 5 | ||||
-rw-r--r-- | lib/zebra.h | 12 |
2 files changed, 15 insertions, 2 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog index 2fee4611..4b245bec 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,8 @@ +2005-01-12 Andrew J. Schorr <ajschorr@alumni.princeton.edu> + + * zebra.h: If not C99 and no va_copy macro available, fall back to + memcpy (solves a build problem on FreeBSD 4.x). + 2005-01-04 Andrew J. Schorr <ajschorr@alumni.princeton.edu> * zebra.h: Define ZCMSG_FIRSTHDR appropriately based on whether 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" |