diff --git a/source/Makefile.mk b/source/Makefile.mk index 1cb523fc9..cd77d4b93 100644 --- a/source/Makefile.mk +++ b/source/Makefile.mk @@ -82,6 +82,9 @@ endif ifeq ($(DEBUG),true) BASE_FLAGS += -DDEBUG -O0 -g +ifeq ($(WIN32),true) +BASE_FLAGS += -msse -msse2 +endif LINK_OPTS = else BASE_FLAGS += -DNDEBUG $(BASE_OPTS) -fvisibility=hidden @@ -131,11 +134,16 @@ ifeq ($(MACOS),true) CFLAGS += -isystem /opt/kxstudio/include CXXFLAGS += -isystem /opt/kxstudio/include endif +ifeq ($(WIN64),true) +CFLAGS += -isystem /opt/mingw64/include +CXXFLAGS += -isystem /opt/mingw64/include +else ifeq ($(WIN32),true) CFLAGS += -isystem /opt/mingw32/include CXXFLAGS += -isystem /opt/mingw32/include endif endif +endif # -------------------------------------------------------------- # Check for required libs diff --git a/source/backend/engine/CarlaEngineJack.cpp b/source/backend/engine/CarlaEngineJack.cpp index d90879989..ea0bca9fc 100644 --- a/source/backend/engine/CarlaEngineJack.cpp +++ b/source/backend/engine/CarlaEngineJack.cpp @@ -719,7 +719,7 @@ public: if (pData->bufferSize == 0 || carla_compareFloats(pData->sampleRate, 0.0)) { // open temp client to get initial buffer-size and sample-rate values - if (jack_client_t* const tmpClient = jackbridge_client_open(clientName, JackNullOption, nullptr)) + if (jack_client_t* const tmpClient = jackbridge_client_open(clientName, JackNoStartServer, nullptr)) { pData->bufferSize = jackbridge_get_buffer_size(tmpClient); pData->sampleRate = jackbridge_get_sample_rate(tmpClient); diff --git a/source/backend/plugin/DssiPlugin.cpp b/source/backend/plugin/DssiPlugin.cpp index 59224582f..eb7126874 100644 --- a/source/backend/plugin/DssiPlugin.cpp +++ b/source/backend/plugin/DssiPlugin.cpp @@ -355,7 +355,7 @@ public: const ScopedSingleProcessLocker spl(this, true); try { - fDssiDescriptor->set_custom_data(fHandle, const_cast(data), dataSize); + fDssiDescriptor->set_custom_data(fHandle, const_cast(data), static_cast(dataSize)); } CARLA_SAFE_EXCEPTION("DssiPlugin::setChunkData"); } diff --git a/source/backend/plugin/JucePlugin.cpp b/source/backend/plugin/JucePlugin.cpp index d2f0e4b8d..86b2fb7e7 100644 --- a/source/backend/plugin/JucePlugin.cpp +++ b/source/backend/plugin/JucePlugin.cpp @@ -30,6 +30,8 @@ using namespace juce; CARLA_BACKEND_START_NAMESPACE +// ----------------------------------------------------- + class JucePlugin : public CarlaPlugin, public AudioPlayHead, public AudioProcessorListener @@ -37,8 +39,16 @@ class JucePlugin : public CarlaPlugin, public: JucePlugin(CarlaEngine* const engine, const uint id) : CarlaPlugin(engine, id), + fDesc(), fInstance(nullptr), - fAudioBuffer(1, 0) + fFormatManager(), + fAudioBuffer(), + fMidiBuffer(), + fPosInfo(), + fChunk(), + fUniqueId(nullptr), + fWindow(), + leakDetector_JucePlugin() { carla_debug("JucePlugin::JucePlugin(%p, %i)", engine, id); diff --git a/source/bridges-plugin/Makefile b/source/bridges-plugin/Makefile index 0e9165367..6805383c1 100644 --- a/source/bridges-plugin/Makefile +++ b/source/bridges-plugin/Makefile @@ -63,7 +63,7 @@ endif # -------------------------------------------------------------- # Plugin bridges (Windows) -WIN_BUILD_FLAGS = $(BUILD_PLUGIN_FLAGS) -DJACKBRIDGE_EXPORTING +WIN_BUILD_FLAGS = $(BUILD_PLUGIN_FLAGS) -DJACKBRIDGE_EXPORTING_LATER WIN_32BIT_FLAGS = $(32BIT_FLAGS) WIN_64BIT_FLAGS = $(64BIT_FLAGS) WIN_LINK_FLAGS = $(LINK_PLUGIN_FLAGS) -L../modules diff --git a/source/includes/CarlaDefines.h b/source/includes/CarlaDefines.h index 0e930713d..d0c5a51f1 100644 --- a/source/includes/CarlaDefines.h +++ b/source/includes/CarlaDefines.h @@ -89,7 +89,7 @@ # define P_INT64 "%I64i" # define P_UINT64 "%I64u" # define P_INTPTR "%I64i" -# define P_UINTPTR "%I64x" +# define P_UINTPTR "%llx" # define P_SIZE "%I64u" #elif defined(CARLA_OS_WIN32) # define P_INT64 "%I64i" diff --git a/source/modules/jackbridge/JackBridge.hpp b/source/modules/jackbridge/JackBridge.hpp index 3cda419b1..b5ba19d7b 100644 --- a/source/modules/jackbridge/JackBridge.hpp +++ b/source/modules/jackbridge/JackBridge.hpp @@ -18,6 +18,9 @@ #define JACKBRIDGE_HPP_INCLUDED #ifdef __WINE__ +# if defined(WIN64) || defined(_WIN64) || defined(__WIN64__) +# define __WINE64__ +# endif # undef WIN32 # undef WIN64 # undef _WIN32 @@ -28,18 +31,20 @@ #include "CarlaDefines.h" -#ifdef JACKBRIDGE_EXPORTING +#if defined(JACKBRIDGE_EXPORTING) # if defined(CARLA_OS_WIN) && ! defined(__WINE__) # define JACKBRIDGE_EXPORT extern "C" __declspec (dllexport) # else # define JACKBRIDGE_EXPORT extern "C" __attribute__ ((visibility("default"))) # endif -#else +#elif defined(JACKBRIDGE_EXPORTING_LATER) # if defined(CARLA_OS_WIN) && ! defined(__WINE__) # define JACKBRIDGE_EXPORT extern "C" __declspec (dllimport) # else -# define JACKBRIDGE_EXPORT +# define JACKBRIDGE_EXPORT extern "C" # endif +#else +# define JACKBRIDGE_EXPORT #endif #ifdef JACKBRIDGE_DIRECT diff --git a/source/modules/jackbridge/JackBridge1.cpp b/source/modules/jackbridge/JackBridge1.cpp index fe1aa1e56..a6f32c98f 100644 --- a/source/modules/jackbridge/JackBridge1.cpp +++ b/source/modules/jackbridge/JackBridge1.cpp @@ -510,7 +510,6 @@ bool jackbridge_is_ok(void) noexcept #elif defined(JACKBRIDGE_DIRECT) return true; #else - carla_stdout("HERE 001"); return (getBridgeInstance().lib != nullptr); #endif } @@ -559,7 +558,6 @@ jack_client_t* jackbridge_client_open(const char* client_name, jack_options_t op #elif defined(JACKBRIDGE_DIRECT) return jack_client_open(client_name, options, status); #else - carla_stdout("HERE 002, %s", client_name); if (getBridgeInstance().client_open_ptr != nullptr) return getBridgeInstance().client_open_ptr(client_name, options, status); #endif @@ -575,7 +573,6 @@ bool jackbridge_client_close(jack_client_t* client) #elif defined(JACKBRIDGE_DIRECT) return (jack_client_close(client) == 0); #else - carla_stdout("HERE 003"); if (getBridgeInstance().client_close_ptr != nullptr) return (getBridgeInstance().client_close_ptr(client) == 0); #endif diff --git a/source/modules/jackbridge/Makefile b/source/modules/jackbridge/Makefile index 93f4c079d..556cf6265 100644 --- a/source/modules/jackbridge/Makefile +++ b/source/modules/jackbridge/Makefile @@ -170,11 +170,9 @@ debug: # -------------------------------------------------------------- %.wine32.o: % -# $(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -DJACKBRIDGE_EXPORT -c -o $@ $(WINECXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -DJACKBRIDGE_EXPORTING -c -o $@ %.wine64.o: % -# $(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -DJACKBRIDGE_EXPORT -c -o $@ $(WINECXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -DJACKBRIDGE_EXPORTING -c -o $@ # -------------------------------------------------------------- diff --git a/source/utils/JucePluginWindow.hpp b/source/utils/JucePluginWindow.hpp index a527a0fe7..ebd8eda12 100644 --- a/source/utils/JucePluginWindow.hpp +++ b/source/utils/JucePluginWindow.hpp @@ -18,7 +18,7 @@ #ifndef JUCE_PLUGIN_WINDOW_HPP_INCLUDED #define JUCE_PLUGIN_WINDOW_HPP_INCLUDED -#include "CarlaUtils.hpp" +#include "CarlaJuceUtils.hpp" #include "juce_gui_basics.h" @@ -39,7 +39,8 @@ class JucePluginWindow : public DocumentWindow public: JucePluginWindow() : DocumentWindow("JucePluginWindow", Colour(50, 50, 200), DocumentWindow::closeButton, false), - fClosed(false) + fClosed(false), + leakDetector_JucePluginWindow() { setVisible(false); //setAlwaysOnTop(true); @@ -104,7 +105,7 @@ protected: private: volatile bool fClosed; - JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(JucePluginWindow) + CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(JucePluginWindow) }; } // namespace juce