From 93194c7a124cdb6b6eeef806e655ac4cccb9df0e Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 24 Dec 2023 12:24:46 +0100 Subject: [PATCH] Import latest fixes from DISTRHO-Ports Signed-off-by: falkTX --- .../juce_audio_plugin_client/LV2/juce_LV2_Wrapper.cpp | 10 +++++----- .../juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp | 2 +- .../utility/juce_IncludeModuleHeaders.h | 2 ++ .../utility/juce_PluginUtilities.cpp | 6 +++--- modules/juce_core/native/juce_posix_SharedCode.h | 2 +- modules/juce_core/system/juce_TargetPlatform.h | 2 +- 6 files changed, 13 insertions(+), 11 deletions(-) diff --git a/modules/juce_audio_plugin_client/LV2/juce_LV2_Wrapper.cpp b/modules/juce_audio_plugin_client/LV2/juce_LV2_Wrapper.cpp index 8ae392cf50..1ec4d3fdc3 100644 --- a/modules/juce_audio_plugin_client/LV2/juce_LV2_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/LV2/juce_LV2_Wrapper.cpp @@ -571,7 +571,7 @@ public: //============================================================================== // Juce calls - void audioProcessorParameterChanged (AudioProcessor*, int index, float newValue) + void audioProcessorParameterChanged (AudioProcessor*, int index, float newValue) override { if (inParameterChangedCallback.get()) { @@ -596,7 +596,7 @@ public: } } - void audioProcessorChanged (AudioProcessor*, const ChangeDetails& details) + void audioProcessorChanged (AudioProcessor*, const ChangeDetails& details) override { if (details.programChanged && filter != nullptr && programsHost != nullptr) { @@ -610,7 +610,7 @@ public: } } - void audioProcessorParameterChangeGestureBegin (AudioProcessor*, int parameterIndex) + void audioProcessorParameterChangeGestureBegin (AudioProcessor*, int parameterIndex) override { if (uiTouch == nullptr) return; @@ -629,7 +629,7 @@ public: } } - void audioProcessorParameterChangeGestureEnd (AudioProcessor*, int parameterIndex) + void audioProcessorParameterChangeGestureEnd (AudioProcessor*, int parameterIndex) override { if (uiTouch == nullptr) return; @@ -667,7 +667,7 @@ public: } } - void timerCallback() + void timerCallback() override { if (externalUI != nullptr && externalUI->isClosed()) { diff --git a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp index 98cdd68a18..7d8ce4d524 100644 --- a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp @@ -434,7 +434,7 @@ public: { const int numChannels = jmax (numIn, numOut); - AudioBuffer chans (tmpBuffers.channels, isMidiEffect ? 0 : numChannels, numSamples); + juce::AudioBuffer chans (tmpBuffers.channels, isMidiEffect ? 0 : numChannels, numSamples); if (isBypassed && processor->getBypassParameter() == nullptr) processor->processBlockBypassed (chans, midiEvents); diff --git a/modules/juce_audio_plugin_client/utility/juce_IncludeModuleHeaders.h b/modules/juce_audio_plugin_client/utility/juce_IncludeModuleHeaders.h index 4b36f6d645..61dbdeede0 100644 --- a/modules/juce_audio_plugin_client/utility/juce_IncludeModuleHeaders.h +++ b/modules/juce_audio_plugin_client/utility/juce_IncludeModuleHeaders.h @@ -23,6 +23,8 @@ ============================================================================== */ +#pragma once + #include #include "juce_CreatePluginFilter.h" diff --git a/modules/juce_audio_plugin_client/utility/juce_PluginUtilities.cpp b/modules/juce_audio_plugin_client/utility/juce_PluginUtilities.cpp index 23236a6978..6c4f0e2ef8 100644 --- a/modules/juce_audio_plugin_client/utility/juce_PluginUtilities.cpp +++ b/modules/juce_audio_plugin_client/utility/juce_PluginUtilities.cpp @@ -54,9 +54,9 @@ namespace juce const auto juce_strcat = [] (auto&& head, auto&&... tail) { strcat_s (head, numElementsInArray (head), tail...); }; const auto juce_sscanf = [] (auto&&... args) { sscanf_s (args...); }; #else - const auto juce_sprintf = [] (auto&&... args) { sprintf (args...); }; - const auto juce_strcpy = [] (auto&&... args) { strcpy (args...); }; - const auto juce_strcat = [] (auto&&... args) { strcat (args...); }; + const auto juce_sprintf = [] (auto&& head, auto&&... args) { snprintf (head, numElementsInArray (head), args...); }; + const auto juce_strcpy = [] (auto&& head, auto&& tail) { strncpy (head, tail, numElementsInArray (head)); }; + const auto juce_strcat = [] (auto&& head, auto&& tail) { strncat (head, tail, numElementsInArray (head)); }; const auto juce_sscanf = [] (auto&&... args) { sscanf (args...); }; #endif diff --git a/modules/juce_core/native/juce_posix_SharedCode.h b/modules/juce_core/native/juce_posix_SharedCode.h index f4bb0b84fe..63771bad4d 100644 --- a/modules/juce_core/native/juce_posix_SharedCode.h +++ b/modules/juce_core/native/juce_posix_SharedCode.h @@ -28,7 +28,7 @@ CriticalSection::CriticalSection() noexcept pthread_mutexattr_t atts; pthread_mutexattr_init (&atts); pthread_mutexattr_settype (&atts, PTHREAD_MUTEX_RECURSIVE); - #if ! JUCE_ANDROID + #if ! JUCE_ANDROID && ! JUCE_ARM pthread_mutexattr_setprotocol (&atts, PTHREAD_PRIO_INHERIT); #endif pthread_mutex_init (&lock, &atts); diff --git a/modules/juce_core/system/juce_TargetPlatform.h b/modules/juce_core/system/juce_TargetPlatform.h index c21cff1792..5daa8e61f5 100644 --- a/modules/juce_core/system/juce_TargetPlatform.h +++ b/modules/juce_core/system/juce_TargetPlatform.h @@ -168,7 +168,7 @@ #define JUCE_BIG_ENDIAN 1 #endif - #if defined (__LP64__) || defined (_LP64) || defined (__arm64__) + #if defined (__LP64__) || defined (_LP64) || defined (__arm64__) || defined (__aarch64__) #define JUCE_64BIT 1 #else #define JUCE_32BIT 1