meson.build: define NOUSER on Windows for lighter windows.h

A few exceptions are needed for sources which include COM header
(directly or indirectly).

This fixes lots of shadow warnings, see
https://github.com/MusicPlayerDaemon/MPD/issues/1150
This commit is contained in:
Max Kellermann
2021-05-19 17:27:51 +02:00
parent a8f05a7efc
commit bcf0fdd3a8
9 changed files with 27 additions and 0 deletions

View File

@@ -23,6 +23,7 @@
#include "HResult.hxx"
#include <combaseapi.h>
#include <objbase.h> // for COINIT_APARTMENTTHREADED
// RAII for Microsoft Component Object Model(COM)
// https://docs.microsoft.com/en-us/windows/win32/api/_com/

View File

@@ -17,6 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#undef NOUSER // COM needs the "MSG" typedef
#include "ComWorker.hxx"
#include "Com.hxx"
#include "thread/Name.hxx"

View File

@@ -17,6 +17,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifdef _WIN32
// COM needs the "MSG" typedef, and audiopolicy.h includes COM headers
#undef NOUSER
#endif
#include "HResult.hxx"
#include "system/Error.hxx"
@@ -25,6 +30,7 @@
#include <cstdio>
#include <memory>
#include <combaseapi.h> // needed by audiopolicy.h if COM_NO_WINDOWS_H is defined
#include <audiopolicy.h>
std::string_view

View File

@@ -20,6 +20,7 @@
#ifndef MPD_WIN32_PROPVARIANT_HXX
#define MPD_WIN32_PROPVARIANT_HXX
#include <combaseapi.h> // needed by propidl.h if COM_NO_WINDOWS_H is defined
#include <propidl.h>
class AllocatedString;