From 832bbed8c367b2d4cf782004c6b0d042e8da87a7 Mon Sep 17 00:00:00 2001 From: reuk Date: Mon, 4 Oct 2021 16:30:54 +0100 Subject: [PATCH] VST3: Fix error when building VST3 plugins On macOS 10.15, stdatomic.h (included by the VST3 SDK) defines a macro named atomic_thread_fence when building in C++20 mode. This macro was trampling over a call to std::atomic_thread_fence from the C++ atomic header, made in juce_Atomic.h. No JUCE implementation files use the C11 atomic functions, so I think it's safe to just undef the problematic symbol after including all the VST3 implementation files. --- modules/juce_audio_processors/format_types/juce_VST3Headers.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/juce_audio_processors/format_types/juce_VST3Headers.h b/modules/juce_audio_processors/format_types/juce_VST3Headers.h index 1ff5037ba4..6bf806f972 100644 --- a/modules/juce_audio_processors/format_types/juce_VST3Headers.h +++ b/modules/juce_audio_processors/format_types/juce_VST3Headers.h @@ -227,3 +227,7 @@ JUCE_END_IGNORE_WARNINGS_GCC_LIKE #undef DEF_CLASS2 #undef DEF_CLASS_W #undef END_FACTORY + +#ifdef atomic_thread_fence + #undef atomic_thread_fence +#endif