From: Junio C Hamano Date: Tue, 15 Mar 2011 21:23:04 +0000 (-0700) Subject: Merge branch 'jk/strbuf-vaddf' X-Git-Tag: v1.7.5-rc0~70 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/d0ef5a7e427d18657b8d53223adc1d7132d6ab79?hp=-c 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 --- d0ef5a7e427d18657b8d53223adc1d7132d6ab79 diff --combined git-compat-util.h index bf947b1ec3,f4cb0a9b01..49b50eec86 --- a/git-compat-util.h +++ b/git-compat-util.h @@@ -214,10 -214,7 +214,10 @@@ extern char *gitbasename(char *) #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) @@@ -538,6 -535,19 +538,19 @@@ void git_qsort(void *base, size_t nmemb #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).