From f03cc1012d96084d18f254681497b72910647013 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 27 May 2020 16:48:44 +0200 Subject: lib/upnp/Compat: workaround for -Wkeyword-macro --- src/lib/upnp/Callback.hxx | 2 +- src/lib/upnp/ClientInit.hxx | 2 +- src/lib/upnp/Compat.hxx | 10 ++++++++++ src/lib/upnp/ContentDirectoryService.hxx | 3 +-- src/lib/upnp/Discovery.hxx | 2 -- src/lib/upnp/Init.cxx | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) (limited to 'src/lib') 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 +#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 +#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 +#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 - #include #include 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 - #include #include 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 #include #include -- cgit v1.2.3