commit 2f560d400acc36f5a6baffd9fbc34e27889f3c81
parent 1a24ca6c7d030cd479fdb4b98e7836b0727ef5ce
Author: falkTX <falktx@falktx.com>
Date: Sun, 8 Aug 2021 15:44:47 +0100
Fix build with old compilers
Signed-off-by: falkTX <falktx@falktx.com>
Diffstat:
8 files changed, 25 insertions(+), 11 deletions(-)
diff --git a/Makefile.plugins.mk b/Makefile.plugins.mk
@@ -75,8 +75,10 @@ ifeq ($(LINUX),true)
VST3_FILENAME = $(TARGET_PROCESSOR)-linux/$(NAME).so
endif
ifeq ($(MACOS),true)
+ifneq ($(MACOS_OLD),true)
VST3_FILENAME = MacOS/$(NAME)
endif
+endif
ifeq ($(WINDOWS),true)
VST3_FILENAME = $(TARGET_PROCESSOR)-win/$(NAME).vst3
endif
diff --git a/dgl/Widget.hpp b/dgl/Widget.hpp
@@ -150,7 +150,11 @@ public:
: BaseEvent(),
keycode(0),
character(0),
+#ifdef DISTRHO_PROPER_CPP11_SUPPORT
string{'\0','\0','\0','\0','\0','\0','\0','\0'} {}
+#else
+ string() { std::memset(string, 0, sizeof(string)); }
+#endif
};
/**
diff --git a/dgl/src/pugl.hpp b/dgl/src/pugl.hpp
@@ -20,9 +20,14 @@
#include "../Base.hpp"
/* we will include all header files used in pugl in their C++ friendly form, then pugl stuff in custom namespace */
-#include <cstdbool>
#include <cstddef>
-#include <cstdint>
+#ifdef DISTRHO_PROPER_CPP11_SUPPORT
+# include <cstdbool>
+# include <cstdint>
+#else
+# include <stdbool.h>
+# include <stdint.h>
+#endif
#define PUGL_API
#define PUGL_DISABLE_DEPRECATED
diff --git a/distrho/DistrhoUtils.hpp b/distrho/DistrhoUtils.hpp
@@ -38,7 +38,7 @@
typedef SSIZE_T ssize_t;
#endif
-#if defined(DISTRHO_OS_MAC) && ! defined(CARLA_OS_MAC) && ! defined(DISTRHO_PROPER_CPP11_SUPPORT)
+#if ! defined(CARLA_MATH_UTILS_HPP_INCLUDED) && ! defined(DISTRHO_PROPER_CPP11_SUPPORT)
namespace std {
inline float fmin(float __x, float __y)
{ return __builtin_fminf(__x, __y); }
diff --git a/distrho/src/DistrhoDefines.h b/distrho/src/DistrhoDefines.h
@@ -64,6 +64,7 @@
#endif
#ifndef DISTRHO_PROPER_CPP11_SUPPORT
+# define constexpr
# define noexcept throw()
# define override
# define final
diff --git a/distrho/src/DistrhoPluginVST2.cpp b/distrho/src/DistrhoPluginVST2.cpp
@@ -132,7 +132,7 @@ struct ParameterAndNotesHelper
# endif
#endif
{
-#ifndef DISTRHO_PROPER_CPP11_SUPPORT
+#if DISTRHO_PLUGIN_HAS_UI && DISTRHO_PLUGIN_WANT_MIDI_INPUT && ! defined(DISTRHO_PROPER_CPP11_SUPPORT)
std::memset(¬esRingBuffer, 0, sizeof(notesRingBuffer));
#endif
}
diff --git a/distrho/src/jackbridge/JackBridge.cpp b/distrho/src/jackbridge/JackBridge.cpp
@@ -36,9 +36,11 @@
#include "../../extra/LibraryUtils.hpp"
// in case JACK fails, we fallback to RtAudio's native API
-#include "RtAudioBridge.hpp"
-#ifdef RTAUDIO_API_TYPE
-# include "rtaudio/RtAudio.cpp"
+#ifdef DISTRHO_PROPER_CPP11_SUPPORT
+# include "RtAudioBridge.hpp"
+# ifdef RTAUDIO_API_TYPE
+# include "rtaudio/RtAudio.cpp"
+# endif
#endif
// -----------------------------------------------------------------------------
diff --git a/examples/FileHandling/NanoButton.cpp b/examples/FileHandling/NanoButton.cpp
@@ -36,15 +36,15 @@ Button::Button(Widget *parent, Callback *cb)
void Button::onNanoDisplay()
{
- auto w = getWidth();
- auto h = getHeight();
- auto margin = 1.0f;
+ const uint w = getWidth();
+ const uint h = getHeight();
+ const float margin = 1.0f;
// Background
beginPath();
fillColor(backgroundColor);
strokeColor(borderColor);
- rect(margin, margin, w - 2 * margin, h-2*margin);
+ rect(margin, margin, w - 2 * margin, h - 2 * margin);
fill();
stroke();
closePath();