From: Ralf Habacker Date: Mon, 22 Oct 2018 15:03:52 +0000 (+0200) Subject: Add cmake support for HAVE_GNUC_VARARGS and HAVE_ISO_VARARGS X-Git-Tag: dbus-1.13.8~43^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd00c5fdef430900d0c848414493a20e59c76b4b;p=thirdparty%2Fdbus.git Add cmake support for HAVE_GNUC_VARARGS and HAVE_ISO_VARARGS Reviewed-by: Simon McVittie Bug: https://gitlab.freedesktop.org/dbus/dbus/merge_requests/18 --- diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake index c14421ff6..88331d7d6 100644 --- a/cmake/ConfigureChecks.cmake +++ b/cmake/ConfigureChecks.cmake @@ -175,6 +175,28 @@ if(NOT HAVE_DIRFD) " HAVE_DDFD) endif() +CHECK_C_SOURCE_COMPILES(" +int a(int p1, int p2, int p3) +{ +} +int main() +{ + #define call_a(params...) a(1,params) + call_a(2,3); +} +" HAVE_GNUC_VARARGS) + +CHECK_C_SOURCE_COMPILES(" +int a(int p1, int p2, int p3) +{ +} +int main() +{ + #define call_a(...) a(1,__VA_ARGS__) + call_a(2,3); +} +" HAVE_ISO_VARARGS) + # missing: # DBUS_HAVE_GCC33_GCOV diff --git a/cmake/config.h.cmake b/cmake/config.h.cmake index f46454aae..af19a8050 100644 --- a/cmake/config.h.cmake +++ b/cmake/config.h.cmake @@ -12,8 +12,13 @@ * Variables defined by AC_DEFINE in ../configure.ac * should be placed in this file */ + +/* Have GNU-style varargs macros */ #cmakedefine HAVE_GNUC_VARARGS 1 +/* Have ISO C99 varargs macros */ +#cmakedefine HAVE_ISO_VARARGS 1 + #cmakedefine DBUS_CONSOLE_AUTH_DIR "@DBUS_CONSOLE_AUTH_DIR@" #cmakedefine DBUS_DATADIR "@DBUS_DATADIR@" #cmakedefine DBUS_BINDIR "@DBUS_BINDIR@"