From 524f52c305b0e1e730994bd308d0d2d5d43bf2c2 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Mon, 29 Jul 2013 10:47:09 -0600 Subject: [PATCH] build: skip systemd mock on non-Linux A cross-compile to mingw failed: CC virsystemdmock_la-virsystemdmock.lo ../../tests/virsystemdmock.c:29:6: error: 'dbus_connection_set_change_sigpipe' redeclared without dllimport attribute: previous dllimport ignored [-Werror=attributes] void dbus_connection_set_change_sigpipe(dbus_bool_t will_modify_sigpipe ATTRIBUTE_UNUSED) ^ But when you think about it, systemd is Linux-only, and even our use of LD_PRELOAD to provide mock syscalls is Linux-only. * tests/virsystemdmock.c: Avoid compilation outside Linux. Signed-off-by: Eric Blake --- tests/virsystemdmock.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/virsystemdmock.c b/tests/virsystemdmock.c index 1f4413c601..b6c36950f8 100644 --- a/tests/virsystemdmock.c +++ b/tests/virsystemdmock.c @@ -20,11 +20,12 @@ #include -#include "internal.h" +#ifdef __linux__ +# include "internal.h" -#include +# include -#include +# include void dbus_connection_set_change_sigpipe(dbus_bool_t will_modify_sigpipe ATTRIBUTE_UNUSED) { @@ -79,3 +80,7 @@ DBusMessage *dbus_connection_send_with_reply_and_block(DBusConnection *connectio return reply; } + +#else +/* Nothing to override on non-__linux__ platforms */ +#endif