Browse Source

Fix build with old compilers

Signed-off-by: falkTX <falktx@falktx.com>
pull/309/head
falkTX 4 years ago
parent
commit
2f560d400a
8 changed files with 25 additions and 11 deletions
  1. +2
    -0
      Makefile.plugins.mk
  2. +4
    -0
      dgl/Widget.hpp
  3. +7
    -2
      dgl/src/pugl.hpp
  4. +1
    -1
      distrho/DistrhoUtils.hpp
  5. +1
    -0
      distrho/src/DistrhoDefines.h
  6. +1
    -1
      distrho/src/DistrhoPluginVST2.cpp
  7. +5
    -3
      distrho/src/jackbridge/JackBridge.cpp
  8. +4
    -4
      examples/FileHandling/NanoButton.cpp

+ 2
- 0
Makefile.plugins.mk View File

@@ -75,8 +75,10 @@ ifeq ($(LINUX),true)
VST3_FILENAME = $(TARGET_PROCESSOR)-linux/$(NAME).so VST3_FILENAME = $(TARGET_PROCESSOR)-linux/$(NAME).so
endif endif
ifeq ($(MACOS),true) ifeq ($(MACOS),true)
ifneq ($(MACOS_OLD),true)
VST3_FILENAME = MacOS/$(NAME) VST3_FILENAME = MacOS/$(NAME)
endif endif
endif
ifeq ($(WINDOWS),true) ifeq ($(WINDOWS),true)
VST3_FILENAME = $(TARGET_PROCESSOR)-win/$(NAME).vst3 VST3_FILENAME = $(TARGET_PROCESSOR)-win/$(NAME).vst3
endif endif


+ 4
- 0
dgl/Widget.hpp View File

@@ -150,7 +150,11 @@ public:
: BaseEvent(), : BaseEvent(),
keycode(0), keycode(0),
character(0), character(0),
#ifdef DISTRHO_PROPER_CPP11_SUPPORT
string{'\0','\0','\0','\0','\0','\0','\0','\0'} {} string{'\0','\0','\0','\0','\0','\0','\0','\0'} {}
#else
string() { std::memset(string, 0, sizeof(string)); }
#endif
}; };


/** /**


+ 7
- 2
dgl/src/pugl.hpp View File

@@ -20,9 +20,14 @@
#include "../Base.hpp" #include "../Base.hpp"


/* we will include all header files used in pugl in their C++ friendly form, then pugl stuff in custom namespace */ /* 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 <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_API
#define PUGL_DISABLE_DEPRECATED #define PUGL_DISABLE_DEPRECATED


+ 1
- 1
distrho/DistrhoUtils.hpp View File

@@ -38,7 +38,7 @@
typedef SSIZE_T ssize_t; typedef SSIZE_T ssize_t;
#endif #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 { namespace std {
inline float fmin(float __x, float __y) inline float fmin(float __x, float __y)
{ return __builtin_fminf(__x, __y); } { return __builtin_fminf(__x, __y); }


+ 1
- 0
distrho/src/DistrhoDefines.h View File

@@ -64,6 +64,7 @@
#endif #endif


#ifndef DISTRHO_PROPER_CPP11_SUPPORT #ifndef DISTRHO_PROPER_CPP11_SUPPORT
# define constexpr
# define noexcept throw() # define noexcept throw()
# define override # define override
# define final # define final


+ 1
- 1
distrho/src/DistrhoPluginVST2.cpp View File

@@ -132,7 +132,7 @@ struct ParameterAndNotesHelper
# endif # endif
#endif #endif
{ {
#ifndef DISTRHO_PROPER_CPP11_SUPPORT
#if DISTRHO_PLUGIN_HAS_UI && DISTRHO_PLUGIN_WANT_MIDI_INPUT && ! defined(DISTRHO_PROPER_CPP11_SUPPORT)
std::memset(&notesRingBuffer, 0, sizeof(notesRingBuffer)); std::memset(&notesRingBuffer, 0, sizeof(notesRingBuffer));
#endif #endif
} }


+ 5
- 3
distrho/src/jackbridge/JackBridge.cpp View File

@@ -36,9 +36,11 @@
#include "../../extra/LibraryUtils.hpp" #include "../../extra/LibraryUtils.hpp"


// in case JACK fails, we fallback to RtAudio's native API // 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 #endif


// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------


+ 4
- 4
examples/FileHandling/NanoButton.cpp View File

@@ -36,15 +36,15 @@ Button::Button(Widget *parent, Callback *cb)


void Button::onNanoDisplay() 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 // Background
beginPath(); beginPath();
fillColor(backgroundColor); fillColor(backgroundColor);
strokeColor(borderColor); strokeColor(borderColor);
rect(margin, margin, w - 2 * margin, h-2*margin);
rect(margin, margin, w - 2 * margin, h - 2 * margin);
fill(); fill();
stroke(); stroke();
closePath(); closePath();


Loading…
Cancel
Save