summaryrefslogtreecommitdiff
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-03-15 21:23:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-03-15 21:23:04 (GMT)
commitd0ef5a7e427d18657b8d53223adc1d7132d6ab79 (patch)
tree16049ebe67fa4ae7b03470ae7effd8ed97d5165c /git-compat-util.h
parentbde7f7389f56bf570c41c8e3f6b58c367b30472a (diff)
parent26db0f2e3afc043e184a5e0ce5eb7c53aeb1f644 (diff)
downloadgit-d0ef5a7e427d18657b8d53223adc1d7132d6ab79.zip
git-d0ef5a7e427d18657b8d53223adc1d7132d6ab79.tar.gz
git-d0ef5a7e427d18657b8d53223adc1d7132d6ab79.tar.bz2
Merge branch 'jk/strbuf-vaddf'
* jk/strbuf-vaddf: compat: fall back on __va_copy if available strbuf: add strbuf_vaddf compat: provide a fallback va_copy definition
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index bf947b1..49b50ee 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -538,6 +538,19 @@ void git_qsort(void *base, size_t nmemb, size_t size,
#define fstat_is_reliable() 1
#endif
+#ifndef va_copy
+/*
+ * Since an obvious implementation of va_list would be to make it a
+ * pointer into the stack frame, a simple assignment will work on
+ * many systems. But let's try to be more portable.
+ */
+#ifdef __va_copy
+#define va_copy(dst, src) __va_copy(dst, src)
+#else
+#define va_copy(dst, src) ((dst) = (src))
+#endif
+#endif
+
/*
* Preserves errno, prints a message, but gives no warning for ENOENT.
* Always returns the return value of unlink(2).