From c39e9f97ab39eb11f23d0cea56d298921c10fbe3 Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 25 Nov 2022 17:39:04 +0000 Subject: [PATCH] make sure to not include windows.h in simde Signed-off-by: falkTX --- include/mingw-compat/condition_variable | 3 ++- include/mingw-compat/future | 1 + include/mingw-compat/mutex | 3 ++- include/mingw-compat/thread | 3 ++- include/simd-compat/pmmintrin.h | 12 ++++++++++++ 5 files changed, 19 insertions(+), 3 deletions(-) diff --git a/include/mingw-compat/condition_variable b/include/mingw-compat/condition_variable index 256734cf..270d7d45 100644 --- a/include/mingw-compat/condition_variable +++ b/include/mingw-compat/condition_variable @@ -1,6 +1,6 @@ /* * DISTRHO Cardinal Plugin - * Copyright (C) 2021 Filipe Coelho + * Copyright (C) 2021-2022 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -19,6 +19,7 @@ #include_next #include "mingw.condition_variable.h" +// fix macro pollution from Windows headers #undef IN #undef OUT #undef far diff --git a/include/mingw-compat/future b/include/mingw-compat/future index b782903c..e2cffc76 100644 --- a/include/mingw-compat/future +++ b/include/mingw-compat/future @@ -19,6 +19,7 @@ #include_next #include "mingw.future.h" +// fix macro pollution from Windows headers #undef IN #undef OUT #undef far diff --git a/include/mingw-compat/mutex b/include/mingw-compat/mutex index 7b828929..15df44ac 100644 --- a/include/mingw-compat/mutex +++ b/include/mingw-compat/mutex @@ -1,6 +1,6 @@ /* * DISTRHO Cardinal Plugin - * Copyright (C) 2021 Filipe Coelho + * Copyright (C) 2021-2022 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -19,6 +19,7 @@ #include_next #include "mingw.mutex.h" +// fix macro pollution from Windows headers #undef IN #undef OUT #undef far diff --git a/include/mingw-compat/thread b/include/mingw-compat/thread index 2d5cb43f..3b2a63c6 100644 --- a/include/mingw-compat/thread +++ b/include/mingw-compat/thread @@ -1,6 +1,6 @@ /* * DISTRHO Cardinal Plugin - * Copyright (C) 2021 Filipe Coelho + * Copyright (C) 2021-2022 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -19,6 +19,7 @@ #include_next #include "mingw.thread.h" +// fix macro pollution from Windows headers #undef IN #undef OUT #undef far diff --git a/include/simd-compat/pmmintrin.h b/include/simd-compat/pmmintrin.h index 8593e1e1..fe72b9e0 100644 --- a/include/simd-compat/pmmintrin.h +++ b/include/simd-compat/pmmintrin.h @@ -23,8 +23,20 @@ // bring in extra SSE3 support via simde # define SIMDE_X86_SSE2_NATIVE # define SIMDE_X86_SSE3_ENABLE_NATIVE_ALIASES + +// make sure to not include windows.h here +# ifdef _WIN32 +# define _WIN32_WAS_DEFINED +# undef _WIN32 +# endif + # include "../simde/simde/x86/sse3.h" +# ifdef _WIN32_WAS_DEFINED +# define _WIN32 +# undef _WIN32_WAS_DEFINED +# endif + #elif defined(__EMSCRIPTEN__) # include_next