diff options
author | Ralf Habacker <ralf.habacker@freenet.de> | 2018-10-25 20:14:24 +0200 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2018-11-15 15:18:22 +0000 |
commit | a0503f0c9914dd2ee4d26f1c049f658f17774d8e (patch) | |
tree | 099a17cf143d92686b4df5c439d983d006c0616b /cmake/config.h.cmake | |
parent | 0732d3ee1b432446661ba7ddcd3dad9ae155786b (diff) | |
download | dbus-a0503f0c9914dd2ee4d26f1c049f658f17774d8e.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.
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 fd193b76..9dbda5a9 100644 --- a/cmake/config.h.cmake +++ b/cmake/config.h.cmake @@ -71,18 +71,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@ +/* Define if va_list cannot be copied as a value */ +#cmakedefine DBUS_VA_COPY_AS_ARRAY 1 #cmakedefine DBUS_WITH_GLIB 1 #cmakedefine GLIB_VERSION_MIN_REQUIRED @GLIB_VERSION_MIN_REQUIRED@ |