diff options
author | Simon McVittie <smcv@collabora.com> | 2022-07-19 20:37:19 +0100 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2022-07-19 20:50:33 +0100 |
commit | a54ed9ffadcbb2bceebdfb5797e38d49c26289eb (patch) | |
tree | 4c83b9174c2bd4cf106ef2e7e9c2f6a74b6d2e75 /cmake | |
parent | bf30fe6d6068bd00ff4b06e667f88e7ca4210cfe (diff) | |
download | dbus-a54ed9ffadcbb2bceebdfb5797e38d49c26289eb.tar.gz |
Remove emulation of va_copy() in non-C99 compilers
dbus now requires a (mostly-)C99 compiler, which guarantees the presence
of Standard C va_copy().
Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/ConfigureChecks.cmake | 45 | ||||
-rw-r--r-- | cmake/config.h.cmake | 6 |
2 files changed, 0 insertions, 51 deletions
diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake index 17b2e201..f4680f9b 100644 --- a/cmake/ConfigureChecks.cmake +++ b/cmake/ConfigureChecks.cmake @@ -81,51 +81,6 @@ epoll_create1 (EPOLL_CLOEXEC); }" DBUS_HAVE_LINUX_EPOLL) CHECK_C_SOURCE_COMPILES(" -#include <stdarg.h> -#include <stdlib.h> -static void f (int i, ...) { - va_list args1, args2; - va_start (args1, i); - va_copy (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; -} -" HAVE_VA_COPY) - -CHECK_C_SOURCE_COMPILES(" -#include <stdarg.h> -#include <stdlib.h> -static void f (int i, ...) { - va_list args1, args2; - va_start (args1, i); - __va_copy (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; -} -" HAVE___VA_COPY) - -if(HAVE_VA_COPY) - set(DBUS_VA_COPY va_copy CACHE STRING "va_copy function") -elseif(HAVE___VA_COPY) - set(DBUS_VA_COPY __va_copy CACHE STRING "va_copy function") -elseif(MSVC) - # this is used for msvc < 2013 - set(DBUS_VA_COPY _DBUS_VA_COPY_ASSIGN) -else() - message(FATAL_ERROR "dbus requires an ISO C99-compatible va_copy() macro, or a similar __va_copy(), or MSVC >= 2010") -endif() - -CHECK_C_SOURCE_COMPILES(" int main() { int a = 4; int b = __sync_sub_and_fetch(&a, 4); diff --git a/cmake/config.h.cmake b/cmake/config.h.cmake index 96a74f08..2efc93f2 100644 --- a/cmake/config.h.cmake +++ b/cmake/config.h.cmake @@ -83,12 +83,6 @@ # define DBUS_ENABLE_X11_AUTOLAUNCH 1 #endif -/* A 'va_copy' style function */ -#cmakedefine DBUS_VA_COPY @DBUS_VA_COPY@ - -/* for msvc */ -#define _DBUS_VA_COPY_ASSIGN(a1,a2) { a1 = a2; } - #cmakedefine DBUS_WITH_GLIB 1 #cmakedefine GLIB_VERSION_MIN_REQUIRED @GLIB_VERSION_MIN_REQUIRED@ #cmakedefine GLIB_VERSION_MAX_ALLOWED @GLIB_VERSION_MAX_ALLOWED@ |