From d0a427044940d196052a6ca0cc3380e2f79d7909 Mon Sep 17 00:00:00 2001
From: Max Kellermann <max.kellermann@gmail.com>
Date: Thu, 28 Dec 2023 21:23:43 +0100
Subject: [PATCH] lib/upnp/Compat: remove obsolete kludges

Those bugs have been fixed looong ago.
---
 src/lib/upnp/Callback.hxx                |  7 ++-----
 src/lib/upnp/ClientInit.hxx              |  7 ++-----
 src/lib/upnp/Compat.hxx                  | 23 -----------------------
 src/lib/upnp/ContentDirectoryService.hxx |  7 ++-----
 src/lib/upnp/Discovery.hxx               |  8 ++------
 src/lib/upnp/Init.cxx                    |  2 +-
 6 files changed, 9 insertions(+), 45 deletions(-)
 delete mode 100644 src/lib/upnp/Compat.hxx

diff --git a/src/lib/upnp/Callback.hxx b/src/lib/upnp/Callback.hxx
index 34223ca96..5d38cfb17 100644
--- a/src/lib/upnp/Callback.hxx
+++ b/src/lib/upnp/Callback.hxx
@@ -1,10 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 // Copyright The Music Player Daemon Project
 
-#ifndef MPD_UPNP_CALLBACK_HXX
-#define MPD_UPNP_CALLBACK_HXX
+#pragma once
 
-#include "Compat.hxx"
+#include <upnp.h>
 
 /**
  * A class that is supposed to be used for libupnp asynchronous
@@ -26,5 +25,3 @@ public:
 
 	virtual int Invoke(Upnp_EventType et, const void *evp) noexcept = 0;
 };
-
-#endif
diff --git a/src/lib/upnp/ClientInit.hxx b/src/lib/upnp/ClientInit.hxx
index a5f5aefdc..b2c5b3fe9 100644
--- a/src/lib/upnp/ClientInit.hxx
+++ b/src/lib/upnp/ClientInit.hxx
@@ -1,15 +1,12 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 // Copyright The Music Player Daemon Project
 
-#ifndef MPD_UPNP_CLIENT_INIT_HXX
-#define MPD_UPNP_CLIENT_INIT_HXX
+#pragma once
 
-#include "Compat.hxx"
+#include <upnp.h>
 
 UpnpClient_Handle
 UpnpClientGlobalInit(const char* iface);
 
 void
 UpnpClientGlobalFinish() noexcept;
-
-#endif
diff --git a/src/lib/upnp/Compat.hxx b/src/lib/upnp/Compat.hxx
deleted file mode 100644
index 6f1b32fcc..000000000
--- a/src/lib/upnp/Compat.hxx
+++ /dev/null
@@ -1,23 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-// Copyright The Music Player Daemon Project
-
-#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"
-
-/* libupnp 1.8.4 uses a flawed kludge to suppress this warning in
-   inline function __list_add_valid() */
-#pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
-#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 7ce9a5087..a4e26e4aa 100644
--- a/src/lib/upnp/ContentDirectoryService.hxx
+++ b/src/lib/upnp/ContentDirectoryService.hxx
@@ -1,10 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 // Copyright The Music Player Daemon Project
 
-#ifndef _UPNPDIR_HXX_INCLUDED_
-#define _UPNPDIR_HXX_INCLUDED_
+#pragma once
 
-#include "Compat.hxx"
+#include <upnp.h>
 
 #include <string>
 #include <forward_list>
@@ -103,5 +102,3 @@ public:
 		return m_friendlyName.c_str();
 	}
 };
-
-#endif /* _UPNPDIR_HXX_INCLUDED_ */
diff --git a/src/lib/upnp/Discovery.hxx b/src/lib/upnp/Discovery.hxx
index 0ec788d27..2b106f51c 100644
--- a/src/lib/upnp/Discovery.hxx
+++ b/src/lib/upnp/Discovery.hxx
@@ -1,10 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 // Copyright The Music Player Daemon Project
 
-#ifndef _UPNPPDISC_H_X_INCLUDED_
-#define _UPNPPDISC_H_X_INCLUDED_
-
-#include "Compat.hxx"
 #include "Callback.hxx"
 #include "Device.hxx"
 #include "lib/curl/Init.hxx"
@@ -14,6 +10,8 @@
 #include "event/InjectEvent.hxx"
 #include "util/IntrusiveList.hxx"
 
+#include <upnp.h>
+
 #include <list>
 #include <vector>
 #include <string>
@@ -174,5 +172,3 @@ private:
 	int Invoke(Upnp_EventType et, const void *evp) noexcept override;
 };
 
-
-#endif /* _UPNPPDISC_H_X_INCLUDED_ */
diff --git a/src/lib/upnp/Init.cxx b/src/lib/upnp/Init.cxx
index 63c3169e7..8923dccc3 100644
--- a/src/lib/upnp/Init.cxx
+++ b/src/lib/upnp/Init.cxx
@@ -2,10 +2,10 @@
 // Copyright The Music Player Daemon Project
 
 #include "Init.hxx"
-#include "Compat.hxx"
 #include "Error.hxx"
 #include "thread/Mutex.hxx"
 
+#include <upnp.h>
 #include <upnptools.h>
 #ifdef USING_PUPNP
 #	include <ixml.h>