From db6ecdbbd4ae4452637a89e21e893570d78d0018 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Tue, 11 May 2021 02:26:57 +0200 Subject: [PATCH] Also define the shobjidl.h define globally This was needed for Wine 6.2. --- meson.build | 9 ++++++++- src/wine-host/bridges/vst3.cpp | 9 --------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/meson.build b/meson.build index d8cc4b50..408a714e 100644 --- a/meson.build +++ b/meson.build @@ -48,14 +48,21 @@ compiler_options = [ '-msse2', ] +# HACK: Some stuff from `windows.h` that we don't need results in conflicting +# definitions, so we'll try to exclude those bits wine_compiler_options = [ - # Some stuff from `windows.h` results in conflicting definitions '-DNOMINMAX', # Winsock conflicts with the Posix sockets API. Before Wine 6.8 there was a # `WINE_NOWINSOCK` that would exclude just `winsock.h` from `windows.h`, but # they got rid of that so we now need to explicitly define the ifdef guards '-D__WINE_WINSOCKAPI_STDLIB_H', '-D_WINSOCKAPI_', + # This is only relevant for Wine 6.2, but commit + # `0c19e2e487d36a89531daf4897c0b6390d82a843`, broke compilation of + # `shobjidl.h` under C++. + # + # https://bugs.winehq.org/show_bug.cgi?id=50670 + '-D__IFileOperation_INTERFACE_DEFINED__', ] # NOTE: GCC doesn't 8-byte align doubles in structs on x86 for ABI-compatibilty diff --git a/src/wine-host/bridges/vst3.cpp b/src/wine-host/bridges/vst3.cpp index 4a35bcac..8a49455c 100644 --- a/src/wine-host/bridges/vst3.cpp +++ b/src/wine-host/bridges/vst3.cpp @@ -22,15 +22,6 @@ #include "vst3-impls/host-context-proxy.h" #include "vst3-impls/plug-frame-proxy.h" -// HACK: As of Wine commit `0c19e2e487d36a89531daf4897c0b6390d82a843` (or Wine -// 6.2), Wine's `shobjidl.h` cannot be compiled under C++ because one of -// the parameters in the file operations interface is now named -// `template`, which is a reserved keyword. Since we do not need this -// interface, we'll just hack around this by making sure it never gets -// defined. -// -// https://bugs.winehq.org/show_bug.cgi?id=50670 -#define __IFileOperation_INTERFACE_DEFINED__ // NOLINTNEXTLINE(bugprone-suspicious-include) #include