author | Junio C Hamano <gitster@pobox.com> | |
Tue, 15 Mar 2011 21:23:04 +0000 (14:23 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 15 Mar 2011 21:23:04 +0000 (14:23 -0700) |
* jk/strbuf-vaddf:
compat: fall back on __va_copy if available
strbuf: add strbuf_vaddf
compat: provide a fallback va_copy definition
compat: fall back on __va_copy if available
strbuf: add strbuf_vaddf
compat: provide a fallback va_copy definition
1 | 2 | |||
---|---|---|---|---|
git-compat-util.h | patch | | diff1 | | diff2 | | blob | history |
diff --combined git-compat-util.h
index bf947b1ec361aafeef58d43ef8eae979699b35ac,f4cb0a9b0182da5366249ce6e53e24773fd2b174..49b50eec86828066c90b6165c35ec21cb51e85ce
--- 1/git-compat-util.h
--- 2/git-compat-util.h
+++ b/git-compat-util.h
#define is_dir_sep(c) ((c) == '/')
#endif
-#ifdef __GNUC__
+#if __HP_cc >= 61000
+#define NORETURN __attribute__((noreturn))
+#define NORETURN_PTR
+#elif defined(__GNUC__)
#define NORETURN __attribute__((__noreturn__))
#define NORETURN_PTR __attribute__((__noreturn__))
#elif defined(_MSC_VER)
#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).