From e5f406b9b6e2a1cd29e878b56d6557be0359b821 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Tue, 12 Aug 2008 17:04:16 +0000 Subject: [PATCH] Thu Jul 24 13:02:17 EDT 2008 Pekka Pessi * sofia-sip/su_tagarg.h: if va_copy is missing, fall back to __va_copy or memcpy git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9269 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- libs/sofia-sip/.update | 2 +- .../sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tagarg.h | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index 9eca0233e5..c255c77370 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1 @@ -Tue Aug 12 13:03:36 EDT 2008 +Tue Aug 12 13:04:10 EDT 2008 diff --git a/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tagarg.h b/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tagarg.h index 6c7fec5150..d904c65974 100644 --- a/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tagarg.h +++ b/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tagarg.h @@ -82,6 +82,14 @@ typedef struct { va_list ap; } ta_list; +#if defined(va_copy) +#define su_va_copy(dst, src) va_copy((dst), (src)) +#elif defined(__va_copy) +#define su_va_copy(dst, src) __va_copy((dst), (src)) +#else +#define su_va_copy(dst, src) (memcpy(&(dst), &(src), sizeof (va_list))) +#endif + /**Macro initializing a ta_list object. * * The ta_start() macro initializes @a ta for subsequent use by ta_args(), @@ -143,7 +151,7 @@ typedef struct { ta_start__tag != tag_null && \ ta_start__tag != tag_next) { \ va_list ta_start__ap; \ - va_copy(ta_start__ap, (ta).ap); \ + su_va_copy(ta_start__ap, (ta).ap); \ (ta).tl[1].t_tag = tag_next; \ (ta).tl[1].t_value = (tag_value_t)tl_vlist(ta_start__ap); \ va_end(ta_start__ap); \