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)
This commit is contained in:
Frank Osterfeld 2009-04-28 17:10:46 +02:00 committed by unknown
parent 45f8e734af
commit ff92d15f94
2 changed files with 11 additions and 7 deletions

View file

@ -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 <stdarg.h>
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)

View file

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