diff --git a/source/libs/distrho-plugin-toolkit/DistrhoUIOpenGLExt.h b/source/libs/distrho-plugin-toolkit/DistrhoUIOpenGLExt.h index 5c6099cbb..536360bd6 100644 --- a/source/libs/distrho-plugin-toolkit/DistrhoUIOpenGLExt.h +++ b/source/libs/distrho-plugin-toolkit/DistrhoUIOpenGLExt.h @@ -22,7 +22,6 @@ #ifdef DISTRHO_UI_OPENGL #include "DistrhoUIOpenGL.h" -#include START_NAMESPACE_DISTRHO diff --git a/source/libs/pugl/pugl_win.cpp b/source/libs/pugl/pugl_win.cpp index 5448e2947..a5d71912d 100644 --- a/source/libs/pugl/pugl_win.cpp +++ b/source/libs/pugl/pugl_win.cpp @@ -110,7 +110,6 @@ puglCreate(PuglNativeWindow parent, // unused (void)resizable; - (void)addToDesktop; (void)x11Display; } diff --git a/source/tests/Makefile b/source/tests/Makefile index 6cd38ade3..14c8a77a5 100644 --- a/source/tests/Makefile +++ b/source/tests/Makefile @@ -9,10 +9,11 @@ include ../Makefile.mk # -------------------------------------------------------------- BUILD_CXX_FLAGS += -I../backend -I../includes -I../utils +# BUILD_CXX_FLAGS += -I/opt/mingw32/include BUILD_CXX_FLAGS += $(shell pkg-config --cflags QtCore) LINK_FLAGS += $(shell pkg-config --libs QtCore) -TARGETS = CarlaString RtList Thread +TARGETS = CarlaString RtList Thread GL_ all: $(TARGETS) RUN @@ -24,11 +25,16 @@ CarlaString: CarlaString.cpp RtList: RtList.cpp ../libs/rtmempool.a $(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -o $@ -Thread_: Thread.cpp +Thread: Thread.cpp $(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -pthread -lpthread -o $@ +GL_: GL.cpp +# $(CXX) $^ $(BUILD_CXX_FLAGS) -I../backend/engine/plugin -I../libs/distrho-plugin-toolkit $(LINK_FLAGS) -lgdi32 -lopengl32 -lole32 -luuid -lws2_32 -o GL # $@ + $(CXX) $^ $(BUILD_CXX_FLAGS) -I../backend/engine/plugin -I../libs/distrho-plugin-toolkit $(LINK_FLAGS) -lGL -lGLU -o GL # $@ + RUN: $(TARGETS) - ./CarlaString && ./RtList && ./Thread +# ./CarlaString && ./RtList && ./Thread +# ./GL # -------------------------------------------------------------- diff --git a/source/utils/carla_utils.hpp b/source/utils/carla_utils.hpp index 95c515f31..ef06018d3 100644 --- a/source/utils/carla_utils.hpp +++ b/source/utils/carla_utils.hpp @@ -350,7 +350,7 @@ public: delete cthread; } #else - if (pthreadId != 0) + if (! _isNull()) pthread_join(pthreadId, nullptr); pthread_attr_destroy(&pthreadAttr); @@ -378,9 +378,9 @@ public: return true; #else - CARLA_ASSERT(pthreadId == 0); + CARLA_ASSERT(_isNull()); - if (pthreadId != 0) + if (! _isNull()) return false; return (pthread_create(&pthreadId, &pthreadAttr, _pthreadRoutine, this) == 0); @@ -398,7 +398,7 @@ public: if (cthread == nullptr) return true; #else - if (pthreadId == 0) + if (_isNull()) return true; #endif @@ -440,7 +440,7 @@ public: if (cthread == nullptr) return; #else - if (pthreadId == 0) + if (_isNull()) return; #endif @@ -515,6 +515,16 @@ private: { ((CarlaThread*)_this_)->handleRoutine(); pthread_exit(nullptr); + return nullptr; + } + + bool _isNull() + { +#ifdef Q_OS_WIN + return pthreadId.p == nullptr; +#else + return pthreadId == 0; +#endif } void _zero() diff --git a/source/utils/rt_list.hpp b/source/utils/rt_list.hpp index 24ca5ecb8..d725da153 100644 --- a/source/utils/rt_list.hpp +++ b/source/utils/rt_list.hpp @@ -427,7 +427,7 @@ public: private: typename List::Data* _allocate() { - return (typename List::Data*)malloc(this->fDataSize); + return (typename List::Data*)malloc(this->kDataSize); } void _deallocate(typename List::Data* const dataPtr)