From ff92d15f949afd9dc544bad4f07c74e401aa2bb2 Mon Sep 17 00:00:00 2001 From: Frank Osterfeld Date: Tue, 28 Apr 2009 17:10:46 +0200 Subject: [PATCH] fix configure check and VA_COPY usage * fix configure check: set DBUS_VA_COPY_FUNC correctly, and DBUS_VA_COPY_AS_ARRAY if no usable one was found * add DBUS_VA_COPY_AS_ARRAY * define DBUS_VA_COPY indirectly, cmakedefine plus variable does not work for me on windows, and is the wrong thing to do according to Allen. The undef seems unnecessary now, the address parsing test passes on windows, using mingw (cherry picked from commit e6680d78d943be4ee2d85e9d82cd8aa1350db882) --- cmake/ConfigureChecks.cmake | 8 +++++--- cmake/config.h.cmake | 10 ++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake index 756d67fe1..c44ea7ae7 100644 --- a/cmake/ConfigureChecks.cmake +++ b/cmake/ConfigureChecks.cmake @@ -105,7 +105,7 @@ try_compile(DBUS_HAVE_VA_COPY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/cmake_try_compile.c) if(DBUS_HAVE_VA_COPY) - SET(DBUS_VA_COPY va_copy CACHE STRING "va_copy function") + SET(DBUS_VA_COPY_FUNC va_copy CACHE STRING "va_copy function") else(DBUS_HAVE_VA_COPY) write_file("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/cmake_try_compile.c" "#include void f (int i, ...) { @@ -121,10 +121,12 @@ else(DBUS_HAVE_VA_COPY) return 0; } ") - try_compile(DBUS_HAVE_VA_COPY + try_compile(DBUS_HAVE___VA_COPY ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/cmake_try_compile.c) if(DBUS_HAVE___VA_COPY) - SET(DBUS_VA_COPY __va_copy CACHE STRING "va_copy function") + SET(DBUS_VA_COPY_FUNC __va_copy CACHE STRING "va_copy function") + else(DBUS_HAVE___VA_COPY) + SET(DBUS_VA_COPY_AS_ARRAY "1" CACHE STRING "'va_lists' cannot be copies as values") endif(DBUS_HAVE___VA_COPY) endif(DBUS_HAVE_VA_COPY) diff --git a/cmake/config.h.cmake b/cmake/config.h.cmake index 63afe558a..047135b21 100644 --- a/cmake/config.h.cmake +++ b/cmake/config.h.cmake @@ -64,7 +64,12 @@ #cmakedefine DBUS_BUILD_X11 1 -#cmakedefine DBUS_VA_COPY @DBUS_VA_COPY_FUNC@ +#cmakedefine DBUS_VA_COPY_FUNC +#if (defined DBUS_VA_COPY_FUNC) +# define DBUS_VA_COPY @DBUS_VA_COPY_FUNC@ +#endif + +#cmakedefine DBUS_VA_COPY_AS_ARRAY 1 // headers /* Define to 1 if you have dirent.h */ @@ -165,9 +170,6 @@ # define strtoull _strtoui64 typedef int mode_t; # endif -# ifdef DBUS_VA_COPY -# undef DBUS_VA_COPY // DBUS_VA_COPY kills mingw's bus-test -# endif #endif // defined(_WIN32) || defined(_WIN64) #ifdef interface -- 2.47.3