diff options
author | Simon McVittie <smcv@collabora.com> | 2018-11-16 16:21:48 +0000 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2018-11-19 11:27:25 +0000 |
commit | f33038bc1b195c91aa70bad405cab4eaf366caea (patch) | |
tree | ff97119e644d449155f9014a00cb14aa80749a29 /configure.ac | |
parent | dab4a12e0e556a5a3c88abfdd83e55cab465b79c (diff) | |
download | dbus-f33038bc1b195c91aa70bad405cab4eaf366caea.tar.gz |
build: Require va_copy() or __va_copy() on non-MSVC compilers
va_copy() is a C99 feature, and should be widely supported by now.
gcc in strict C89 mode implements an equivalent __va_copy() instead.
MSVC 2013 implements va_copy(), but at the moment we still aim to support
MSVC 2010 and 2012, which don't have it. However, we know that in
Windows ABIs, va_list is a pointer, so we can use
_DBUS_VA_COPY_ASSIGN. We do not support MSVC for Autotools builds, only
CMake, due to its non-Unixish command-line interface.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/configure.ac b/configure.ac index fa542290..45bd8d66 100644 --- a/configure.ac +++ b/configure.ac @@ -565,38 +565,7 @@ fi AS_IF([test -n "$dbus_va_copy_func"], [AC_DEFINE_UNQUOTED([DBUS_VA_COPY], [$dbus_va_copy_func], [A 'va_copy' style function])], - [ - AC_LANG_PUSH([C]) - AC_CACHE_CHECK([whether va_lists can be copied by value], - [dbus_cv_va_val_copy], - [AC_RUN_IFELSE([ - AC_LANG_PROGRAM([[ - #include <stdarg.h> - #include <stdlib.h> - ]], - [[ - static void f (int i, ...) { - va_list args1, args2; - va_start (args1, i); - args2 = args1; - if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42) - exit (1); - va_end (args1); va_end (args2); - } - int main() { - f (0, 42); - return 0; - } - ]]) - ], - [dbus_cv_va_val_copy=yes], - [dbus_cv_va_val_copy=no], - [dbus_cv_va_val_copy=yes]) - ]) - AC_LANG_POP([C]) - AS_IF([test "x$dbus_cv_va_val_copy" = "xno"], - [AC_DEFINE([DBUS_VA_COPY_AS_ARRAY], 1, [Define if 'va_list' cannot be copied as a value])]) - ]) + [AC_MSG_ERROR([dbus requires an ISO C99-compatible va_copy() macro, or a compatible __va_copy(), or MSVC >= 2010 and CMake])]) #### Atomic integers |