lib/upnp/ContentDirectoryService: include some headers only with libpupnp

This commit is contained in:
Max Kellermann 2023-12-28 21:12:32 +01:00
parent 09a0f7a45c
commit d9fb152b95
5 changed files with 20 additions and 34 deletions

View File

@ -2,16 +2,17 @@
// Copyright The Music Player Daemon Project
#include "lib/upnp/ContentDirectoryService.hxx"
#include "config.h"
#ifdef USING_PUPNP
# include "lib/upnp/ixmlwrap.hxx"
#endif
#include "lib/upnp/UniqueIxml.hxx"
#include "lib/upnp/Action.hxx"
#include "lib/upnp/Error.hxx"
#include "Directory.hxx"
#include "util/NumberParser.hxx"
#include "util/ScopeExit.hxx"
#include "config.h"
#ifdef USING_PUPNP
#include "lib/upnp/ixmlwrap.hxx"
#include "lib/upnp/Action.hxx"
#include "lib/upnp/UniqueIxml.hxx"
#endif
#include <fmt/format.h>

View File

@ -1,8 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later
// Copyright The Music Player Daemon Project
#ifndef MPD_UPNP_ACTION_HXX
#define MPD_UPNP_ACTION_HXX
#pragma once
#include <upnptools.h>
@ -20,7 +19,6 @@ CountNameValuePairs([[maybe_unused]] const char *name, [[maybe_unused]] const ch
return 1 + CountNameValuePairs(args...);
}
#ifdef USING_PUPNP
/**
* A wrapper for UpnpMakeAction() that counts the number of name/value
* pairs and adds the nullptr sentinel.
@ -35,6 +33,3 @@ MakeActionHelper(const char *action_name, const char *service_type,
args...,
nullptr, nullptr);
}
#endif
#endif

View File

@ -1,19 +1,19 @@
// SPDX-License-Identifier: GPL-2.0-or-later
// Copyright The Music Player Daemon Project
#include "config.h"
#include "ContentDirectoryService.hxx"
#include "Device.hxx"
#include "Error.hxx"
#include "UniqueIxml.hxx"
#ifdef USING_PUPNP
# include "ixmlwrap.hxx"
#endif
#include "Action.hxx"
#include "util/IterableSplitString.hxx"
#include "util/UriRelative.hxx"
#include "util/UriUtil.hxx"
#include "config.h"
#ifdef USING_PUPNP
#include "ixmlwrap.hxx"
#include "Action.hxx"
#include "UniqueIxml.hxx"
#endif
#include <algorithm>

View File

@ -1,13 +1,11 @@
// SPDX-License-Identifier: GPL-2.0-or-later
// Copyright The Music Player Daemon Project
#ifndef MPD_UPNP_UNIQUE_XML_HXX
#define MPD_UPNP_UNIQUE_XML_HXX
#pragma once
#ifdef USING_PUPNP
# include <ixml.h>
#include <ixml.h>
# include <memory>
#include <memory>
struct UpnpIxmlDeleter {
void operator()(IXML_Document *doc) noexcept {
@ -21,6 +19,3 @@ struct UpnpIxmlDeleter {
typedef std::unique_ptr<IXML_Document, UpnpIxmlDeleter> UniqueIxmlDocument;
typedef std::unique_ptr<IXML_NodeList, UpnpIxmlDeleter> UniqueIxmlNodeList;
#endif /* USING_PUPNP */
#endif

View File

@ -1,11 +1,9 @@
// SPDX-License-Identifier: GPL-2.0-or-later
// Copyright J.F.Dockes
#ifndef _IXMLWRAP_H_INCLUDED_
#define _IXMLWRAP_H_INCLUDED_
#pragma once
#ifdef USING_PUPNP
# include <ixml.h>
#include <ixml.h>
namespace ixmlwrap {
/**
@ -17,6 +15,3 @@ namespace ixmlwrap {
const char *name) noexcept;
}
#endif /* USING_PUPNP */
#endif /* _IXMLWRAP_H_INCLUDED_ */