From: Jeff King Date: Sat, 26 Feb 2011 05:08:25 +0000 (-0600) Subject: compat: provide a fallback va_copy definition X-Git-Tag: v1.7.5-rc0~57^2~5 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ab8632ae36d2e5faf524309696725b60ec18e588;p=git.git compat: provide a fallback va_copy definition va_copy is C99. We have avoided using va_copy many times in the past, which has led to a bunch of cut-and-paste. From everything I found searching the web, implementations have historically either provided va_copy or just let your code assume that simple assignment of worked. So my guess is that this will be sufficient, though we won't really know for sure until somebody reports a problem. Signed-off-by: Jeff King Improved-by: Erik Faye-Lund Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- diff --git a/compat/msvc.h b/compat/msvc.h index 023aba023..a33b01c03 100644 --- a/compat/msvc.h +++ b/compat/msvc.h @@ -9,7 +9,6 @@ #define inline __inline #define __inline__ __inline #define __attribute__(x) -#define va_copy(dst, src) ((dst) = (src)) #define strncasecmp _strnicmp #define ftruncate _chsize diff --git a/git-compat-util.h b/git-compat-util.h index 9c23622ed..00d41e4f0 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -535,6 +535,10 @@ void git_qsort(void *base, size_t nmemb, size_t size, #define fstat_is_reliable() 1 #endif +#ifndef va_copy +#define va_copy(dst,src) (dst) = (src) +#endif + /* * Preserves errno, prints a message, but gives no warning for ENOENT. * Always returns the return value of unlink(2).