summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2020-05-27 16:48:44 +0200
committerMax Kellermann <max@musicpd.org>2020-05-27 16:50:27 +0200
commitf03cc1012d96084d18f254681497b72910647013 (patch)
treec1ad551b2dd18597d8793a176cda581215b1cd5e
parent736a696f9804504479805eec91efa0779a2a7650 (diff)
lib/upnp/Compat: workaround for -Wkeyword-macro
-rw-r--r--src/lib/upnp/Callback.hxx2
-rw-r--r--src/lib/upnp/ClientInit.hxx2
-rw-r--r--src/lib/upnp/Compat.hxx10
-rw-r--r--src/lib/upnp/ContentDirectoryService.hxx3
-rw-r--r--src/lib/upnp/Discovery.hxx2
-rw-r--r--src/lib/upnp/Init.cxx2
6 files changed, 14 insertions, 7 deletions
diff --git a/src/lib/upnp/Callback.hxx b/src/lib/upnp/Callback.hxx
index c30a317e6..137c479eb 100644
--- a/src/lib/upnp/Callback.hxx
+++ b/src/lib/upnp/Callback.hxx
@@ -20,7 +20,7 @@
#ifndef MPD_UPNP_CALLBACK_HXX
#define MPD_UPNP_CALLBACK_HXX
-#include <upnp.h>
+#include "Compat.hxx"
/**
* A class that is supposed to be used for libupnp asynchronous
diff --git a/src/lib/upnp/ClientInit.hxx b/src/lib/upnp/ClientInit.hxx
index 1e5cae5aa..e8b688190 100644
--- a/src/lib/upnp/ClientInit.hxx
+++ b/src/lib/upnp/ClientInit.hxx
@@ -20,7 +20,7 @@
#ifndef MPD_UPNP_CLIENT_INIT_HXX
#define MPD_UPNP_CLIENT_INIT_HXX
-#include <upnp.h>
+#include "Compat.hxx"
UpnpClient_Handle
UpnpClientGlobalInit();
diff --git a/src/lib/upnp/Compat.hxx b/src/lib/upnp/Compat.hxx
index efe8c8e9c..08cb23a4b 100644
--- a/src/lib/upnp/Compat.hxx
+++ b/src/lib/upnp/Compat.hxx
@@ -20,6 +20,16 @@
#ifndef MPD_UPNP_COMPAT_HXX
#define MPD_UPNP_COMPAT_HXX
+#ifdef __clang__
+/* libupnp versions until 1.10.1 redefine "bool" and "true" */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wkeyword-macro"
+#endif
+
#include <upnp.h>
+#ifdef __clang__
+#pragma GCC diagnostic pop
+#endif
+
#endif
diff --git a/src/lib/upnp/ContentDirectoryService.hxx b/src/lib/upnp/ContentDirectoryService.hxx
index d2588cbdd..fa842c308 100644
--- a/src/lib/upnp/ContentDirectoryService.hxx
+++ b/src/lib/upnp/ContentDirectoryService.hxx
@@ -20,10 +20,9 @@
#ifndef _UPNPDIR_HXX_INCLUDED_
#define _UPNPDIR_HXX_INCLUDED_
+#include "Compat.hxx"
#include "util/Compiler.h"
-#include <upnp.h>
-
#include <string>
#include <forward_list>
diff --git a/src/lib/upnp/Discovery.hxx b/src/lib/upnp/Discovery.hxx
index c0f10b7ec..ce81ec8f5 100644
--- a/src/lib/upnp/Discovery.hxx
+++ b/src/lib/upnp/Discovery.hxx
@@ -29,8 +29,6 @@
#include "thread/Mutex.hxx"
#include "event/DeferEvent.hxx"
-#include <upnp.h>
-
#include <boost/intrusive/list.hpp>
#include <list>
diff --git a/src/lib/upnp/Init.cxx b/src/lib/upnp/Init.cxx
index 4e3176db3..def851f2c 100644
--- a/src/lib/upnp/Init.cxx
+++ b/src/lib/upnp/Init.cxx
@@ -18,10 +18,10 @@
*/
#include "Init.hxx"
+#include "Compat.hxx"
#include "thread/Mutex.hxx"
#include "util/RuntimeError.hxx"
-#include <upnp.h>
#include <upnptools.h>
#include <ixml.h>