From 5577c4bfd842c60a8ae8ce2889bbfeb53a51c62b Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Tue, 11 May 2021 02:21:23 +0200 Subject: [PATCH] Fix build on Wine 6.8 #103 Wine dropped `WINE_NOWINSOCK`, so now we sadly have to define this globally instead. --- CHANGELOG.md | 5 +++++ meson.build | 6 +++++- src/wine-host/bridges/vst2.h | 3 ++- src/wine-host/editor.h | 3 ++- src/wine-host/utils.h | 3 ++- 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 388ab699..0406fbbf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,11 @@ Versioning](https://semver.org/spec/v2.0.0.html). objects on both sides. This greatly reduces the overhead of our VST3 bridging by getting rid of all memory allocations during audio processing. +### Fixed + +- Fixed builds on Wine 6.8 because of internal changes to Wine's `windows.h` + implementation. + ## [3.2.0] - 2021-05-03 ### Added diff --git a/meson.build b/meson.build index dfc69174..71e1663c 100644 --- a/meson.build +++ b/meson.build @@ -212,7 +212,11 @@ if with_vst3 vst3_wine_compiler_options = [ # Some stuff from `windows.h` results in conflicting definitions '-DNOMINMAX', - '-DWINE_NOWINSOCK', + # 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_', ] vst3_base_wine_64bit = static_library( 'vst3_base_wine_64bit', diff --git a/src/wine-host/bridges/vst2.h b/src/wine-host/bridges/vst2.h index 4326a436..f5d5331e 100644 --- a/src/wine-host/bridges/vst2.h +++ b/src/wine-host/bridges/vst2.h @@ -20,7 +20,8 @@ #ifndef NOMINMAX #define NOMINMAX -#define WINE_NOWINSOCK +#define __WINE_WINSOCKAPI_STDLIB_H +#define _WINSOCKAPI_ #endif #include #include diff --git a/src/wine-host/editor.h b/src/wine-host/editor.h index 6b9015bd..8a23875b 100644 --- a/src/wine-host/editor.h +++ b/src/wine-host/editor.h @@ -22,7 +22,8 @@ #ifndef NOMINMAX #define NOMINMAX -#define WINE_NOWINSOCK +#define __WINE_WINSOCKAPI_STDLIB_H +#define _WINSOCKAPI_ #endif #include #include diff --git a/src/wine-host/utils.h b/src/wine-host/utils.h index 29836930..9de31ed9 100644 --- a/src/wine-host/utils.h +++ b/src/wine-host/utils.h @@ -25,7 +25,8 @@ #ifndef NOMINMAX #define NOMINMAX -#define WINE_NOWINSOCK +#define __WINE_WINSOCKAPI_STDLIB_H +#define _WINSOCKAPI_ #endif #include