diff options
author | Patrick Monnerat <Patrick.Monnerat@datasphere.ch> | 2013-12-12 15:04:43 +0800 |
---|---|---|
committer | Daniel Veillard <veillard@redhat.com> | 2013-12-12 15:04:43 +0800 |
commit | 0f7a26d8442b87fb7d576e759c9148e8feff9e20 (patch) | |
tree | 4f7a37e8879f30d704ef8fd5fbdece8a38f4fcfb /xmlwriter.c | |
parent | 147aaf21eaf57b1b685b757b23b5c1ce32d9412a (diff) | |
download | android_external_libxml2-0f7a26d8442b87fb7d576e759c9148e8feff9e20.tar.gz android_external_libxml2-0f7a26d8442b87fb7d576e759c9148e8feff9e20.tar.bz2 android_external_libxml2-0f7a26d8442b87fb7d576e759c9148e8feff9e20.zip |
Improve va_list portability
Support for va_list declared as an array (cannot be referenced
explicitly)
Diffstat (limited to 'xmlwriter.c')
-rw-r--r-- | xmlwriter.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/xmlwriter.c b/xmlwriter.c index d3f29f8e..2e21d1ba 100644 --- a/xmlwriter.c +++ b/xmlwriter.c @@ -31,9 +31,8 @@ /* * The following VA_COPY was coded following an example in * the Samba project. It may not be sufficient for some - * esoteric implementations of va_list (i.e. it may need - * something involving a memcpy) but (hopefully) will be - * sufficient for libxml2. + * esoteric implementations of va_list but (hopefully) will + * be sufficient for libxml2. */ #ifndef VA_COPY #ifdef HAVE_VA_COPY @@ -42,7 +41,12 @@ #ifdef HAVE___VA_COPY #define VA_COPY(dest,src) __va_copy(dest, src) #else - #define VA_COPY(dest,src) (dest) = (src) + #ifndef VA_LIST_IS_ARRAY + #define VA_COPY(dest,src) (dest) = (src) + #else + #include <string.h> + #define VA_COPY(dest,src) memcpy((char *)(dest),(char *)(src),sizeof(va_list)) + #endif #endif #endif #endif |