diff options
author | Ralf Habacker <ralf.habacker@freenet.de> | 2018-10-20 22:34:33 +0200 |
---|---|---|
committer | Ralf Habacker <ralf.habacker@freenet.de> | 2018-10-24 10:03:30 +0200 |
commit | bd6ece893a45e8103a696ee64adc1baa2096c422 (patch) | |
tree | fee9820b43b4e8658b72164a2f1883fe42205d07 /cmake/config.h.cmake | |
parent | 2934dedd1c71aa9af20a266c827c3f8e02c13cd5 (diff) | |
download | dbus-bd6ece893a45e8103a696ee64adc1baa2096c422.tar.gz |
Refactor cmake checks for DBUS_VA_COPY and DBUS_VA_COPY_ARRAY
For test case execution, CheckCSourceCompiles is now used instead
of try_compile and the determination of DBUS_VA_AS_ARRAY is
performed with a separate test instead of evaluating the result
of HAVE_VA_COPY and HAVE___VA_COPY.
The tests are performed for all supported compilers. Since older
MSVC compilers (< 2013) do not support va_copy(), the macro
_DBUS_VA_ASSIGN(a1,a2) with the implementation { a1 = a2; } is used
as a fallback.
Reviewed-by: Simon McVittie <smcv@collabora.com>
Bug: https://gitlab.freedesktop.org/dbus/dbus/merge_requests/18
Diffstat (limited to 'cmake/config.h.cmake')
-rw-r--r-- | cmake/config.h.cmake | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/cmake/config.h.cmake b/cmake/config.h.cmake index 71a02837..dc5d990b 100644 --- a/cmake/config.h.cmake +++ b/cmake/config.h.cmake @@ -66,18 +66,14 @@ # define DBUS_ENABLE_X11_AUTOLAUNCH 1 #endif -#define _DBUS_VA_COPY_ASSIGN(a1,a2) { a1 = a2; } - -#cmakedefine DBUS_VA_COPY_FUNC -#if (defined DBUS_VA_COPY_FUNC) -# define DBUS_VA_COPY @DBUS_VA_COPY_FUNC@ -#endif +/* A 'va_copy' style function */ +#cmakedefine DBUS_VA_COPY @DBUS_VA_COPY@ -#ifdef DBUS_VA_COPY_FUNC -#undef DBUS_VA_COPY_FUNC -#endif +/* for msvc */ +#define _DBUS_VA_COPY_ASSIGN(a1,a2) { a1 = a2; } -#cmakedefine DBUS_VA_COPY_AS_ARRAY @DBUS_VA_COPY_AS_ARRAY@ +/* 'va_lists' cannot be copies as values */ +#cmakedefine DBUS_VA_COPY_AS_ARRAY 1 #cmakedefine DBUS_WITH_GLIB 1 #cmakedefine GLIB_VERSION_MIN_REQUIRED @GLIB_VERSION_MIN_REQUIRED@ |