summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2009-09-29 13:47:46 +0200
committerGuillem Jover <guillem@debian.org>2009-09-30 21:39:06 +0200
commit7e8415be3f31884f3fb2c99ef9255344b67bec21 (patch)
tree3e192f53a1ca96da1f51aaad525ca1ec2d525bb0
parenta31d6e1c1b8438a0ec968c05c58a690eb9023f1d (diff)
downloaddpkg-7e8415be3f31884f3fb2c99ef9255344b67bec21.tar.gz
build: Use memcpy instead of assignment to copy va_list
It's more portable that way. Remove now unneeded check for working assignment.
-rw-r--r--lib/compat/compat.h3
-rw-r--r--m4/funcs.m411
2 files changed, 3 insertions, 11 deletions
diff --git a/lib/compat/compat.h b/lib/compat/compat.h
index 3af717d1a..7e99d05e0 100644
--- a/lib/compat/compat.h
+++ b/lib/compat/compat.h
@@ -44,7 +44,8 @@ extern "C" {
#endif
#ifndef HAVE_VA_COPY
-#define va_copy(dest, src) (dest) = (src)
+#include <string.h>
+#define va_copy(dest, src) memcpy(&(dest), &(src), sizeof(va_list))
#endif
#include <strnlen.h>
diff --git a/m4/funcs.m4 b/m4/funcs.m4
index e1e48e190..4c2dd6ba8 100644
--- a/m4/funcs.m4
+++ b/m4/funcs.m4
@@ -19,16 +19,7 @@ exit (0);
[dpkg_cv_va_copy=no])])
AS_IF([test "x$dpkg_cv_va_copy" = "xyes"],
[AC_DEFINE([HAVE_VA_COPY], 1,
- [Define to 1 if the 'va_copy' macro exists])],
- [AC_CACHE_CHECK([for va_list assignment by copy],
- [dpkg_cv_va_list_copy],
-[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
-[[#include <stdarg.h>]],
-[[va_list v1, v2;
-v1 = v2;
-]])],
- [dpkg_cv_va_list_copy=yes],
- [dpkg_cv_va_list_copy=no])])])
+ [Define to 1 if the 'va_copy' macro exists])])
])# DPKG_FUNC_VA_COPY
# DPKG_CHECK_COMPAT_FUNCS(LIST)