summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2016-12-13 17:48:20 +0200
committerTor Lillqvist <tml@collabora.com>2016-12-13 18:31:29 +0200
commitfee59313ce70cc27112c0f4b031585441fd0f348 (patch)
tree2af94ce75830bedf00e318beefbcde99c6603f64 /sd
parentc5e2eeb19cb4539c207a532d483440a9fb5f98e1 (diff)
Fix weird configury option combination lossage
Change-Id: If67e703d82846c17deecff3e04172bfa339888a6
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/remotecontrol/AvahiNetworkService.cxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/sd/source/ui/remotecontrol/AvahiNetworkService.cxx b/sd/source/ui/remotecontrol/AvahiNetworkService.cxx
index 9d1204eda148..aea4513ab6d0 100644
--- a/sd/source/ui/remotecontrol/AvahiNetworkService.cxx
+++ b/sd/source/ui/remotecontrol/AvahiNetworkService.cxx
@@ -1,4 +1,4 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
/*
* This file is part of the LibreOffice project.
*
@@ -6,6 +6,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+
+#include <config_dbus.h>
+
#include <time.h>
#include <iostream>
#include <limits>
@@ -22,7 +25,10 @@
#include <avahi-common/timeval.h>
#include <avahi-common/thread-watch.h>
#include <comphelper/random.hxx>
+
+#if ENABLE_DBUS
#include <dbus/dbus.h>
+#endif
#include <sal/log.hxx>
@@ -161,12 +167,18 @@ static void client_callback(AvahiClient *c, AvahiClientState state, AVAHI_GCC_UN
}
void AvahiNetworkService::setup() {
+#if ENABLE_DBUS
+ // Sure, without ENABLE_DBUS it probably makes no sense to try to use this Avahi stuff either,
+ // but this is just a stop-gap measure to get this to even compile for now with the probably
+ // pointless combination of configury options --enable-avahi --enable-dbus --disable-gui.
+
// Avahi internally uses D-Bus, which requires the following in order to be
// thread-safe (and we potentially access D-Bus from different threads in
// different places of the code base):
if (!dbus_threads_init_default()) {
throw std::bad_alloc();
}
+#endif
int error = 0;
avahiService = this;