Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2011-02-26 08:08:25 +0300
committerJunio C Hamano <gitster@pobox.com>2011-02-26 12:06:50 +0300
commitab8632ae36d2e5faf524309696725b60ec18e588 (patch)
tree1ed044a4c4546d92e2e09565fb81d7fec7dcaad0 /git-compat-util.h
parent046613c5465e4fc0611f93a5ef31d3815fb50c22 (diff)
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 <peff@peff.net> Improved-by: Erik Faye-Lund <kusmabite@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index 9c23622ed5..00d41e4f0e 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).