From f17fd1cc4e8d69f92986b6f452618c6c1b9819dc Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 30 Aug 2013 17:45:52 +0100 Subject: Define DBUS_COMPILATION externally for all tests that use internal stuff It might as well go in the AM_CPPFLAGS rather than in the source code. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852 Reviewed-by: Ralf Habacker --- cmake/CMakeLists.txt | 2 +- test/Makefile.am | 1 + test/internals/printf.c | 1 - test/internals/refs.c | 1 - test/internals/syslog.c | 1 - test/shell-test.c | 2 +- test/spawn-test.c | 2 -- test/test-utils.h | 4 ---- 8 files changed, 3 insertions(+), 11 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index bde43f03..32edc510 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -478,7 +478,7 @@ set(DBUS_INTERNAL_LIBRARIES dbus-internal) # important note: DBUS_INTERNAL_xxxxx_DEFINITIONS must *not* be set when building dbus-1 library set (DBUS_INTERNAL_ADD_LIBRARY_OPTIONS STATIC) set (DBUS_INTERNAL_LIBRARY_DEFINITIONS "-DDBUS_STATIC_BUILD") -set (DBUS_INTERNAL_CLIENT_DEFINITIONS "-DDBUS_STATIC_BUILD") +set (DBUS_INTERNAL_CLIENT_DEFINITIONS "-DDBUS_STATIC_BUILD -DDBUS_COMPILATION") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h ) diff --git a/test/Makefile.am b/test/Makefile.am index 8b2a5255..fe163c64 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -19,6 +19,7 @@ AM_LDFLAGS = @R_DYNAMIC_LDFLAG@ static_cppflags = \ $(AM_CPPFLAGS) \ -DDBUS_STATIC_BUILD \ + -DDBUS_COMPILATION \ $(NULL) libdbus_testutils_la_CPPFLAGS = \ diff --git a/test/internals/printf.c b/test/internals/printf.c index 2d2fff8d..db151518 100644 --- a/test/internals/printf.c +++ b/test/internals/printf.c @@ -26,7 +26,6 @@ #include -#define DBUS_COMPILATION /* this test uses libdbus-internal */ #include #include #include diff --git a/test/internals/refs.c b/test/internals/refs.c index db43a4da..202dc043 100644 --- a/test/internals/refs.c +++ b/test/internals/refs.c @@ -29,7 +29,6 @@ #include #include -#define DBUS_COMPILATION /* this test uses libdbus-internal */ #include #include #include diff --git a/test/internals/syslog.c b/test/internals/syslog.c index 658281cb..2811b757 100644 --- a/test/internals/syslog.c +++ b/test/internals/syslog.c @@ -30,7 +30,6 @@ #include -#define DBUS_COMPILATION /* this test uses libdbus-internal */ #include #include diff --git a/test/shell-test.c b/test/shell-test.c index b479a9c6..d1dc5b5b 100644 --- a/test/shell-test.c +++ b/test/shell-test.c @@ -1,7 +1,7 @@ #include #include #include -#define DBUS_COMPILATION + #include #include #include diff --git a/test/spawn-test.c b/test/spawn-test.c index f1a55051..e6513fa6 100644 --- a/test/spawn-test.c +++ b/test/spawn-test.c @@ -1,10 +1,8 @@ #include #include -#define DBUS_COMPILATION /* cheat and use dbus-sysdeps */ #include #include -#undef DBUS_COMPILATION #include static void diff --git a/test/test-utils.h b/test/test-utils.h index 3e1e55e6..8d5357e1 100644 --- a/test/test-utils.h +++ b/test/test-utils.h @@ -1,14 +1,10 @@ #ifndef TEST_UTILS_H #define TEST_UTILS_H -#ifndef DBUS_COMPILATION -#define DBUS_COMPILATION /* Cheat and use private stuff */ -#endif #include #include #include #include #include -#undef DBUS_COMPILATION dbus_bool_t test_connection_setup (DBusLoop *loop, DBusConnection *connection); -- cgit v1.2.3