Add cmake support for HAVE_GNUC_VARARGS and HAVE_ISO_VARARGS

Reviewed-by: Simon McVittie <smcv@collabora.com>
Bug: https://gitlab.freedesktop.org/dbus/dbus/merge_requests/18
This commit is contained in:
Ralf Habacker 2018-10-22 17:03:52 +02:00
parent 72b0aebb6e
commit fd00c5fdef
2 changed files with 27 additions and 0 deletions

View file

@ -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

View file

@ -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@"