aboutsummaryrefslogtreecommitdiffstats
path: root/xmlreader.c
diff options
context:
space:
mode:
authorPatrick Monnerat <Patrick.Monnerat@datasphere.ch>2013-12-12 15:04:43 +0800
committerDaniel Veillard <veillard@redhat.com>2013-12-12 15:04:43 +0800
commit0f7a26d8442b87fb7d576e759c9148e8feff9e20 (patch)
tree4f7a37e8879f30d704ef8fd5fbdece8a38f4fcfb /xmlreader.c
parent147aaf21eaf57b1b685b757b23b5c1ce32d9412a (diff)
downloadandroid_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 'xmlreader.c')
-rw-r--r--xmlreader.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/xmlreader.c b/xmlreader.c
index 00083d0e..c5b683dc 100644
--- a/xmlreader.c
+++ b/xmlreader.c
@@ -51,9 +51,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
@@ -62,7 +61,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