| @@ -22,7 +22,6 @@ | |||||
| #ifdef DISTRHO_UI_OPENGL | #ifdef DISTRHO_UI_OPENGL | ||||
| #include "DistrhoUIOpenGL.h" | #include "DistrhoUIOpenGL.h" | ||||
| #include <GL/gl.h> | |||||
| START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
| @@ -110,7 +110,6 @@ puglCreate(PuglNativeWindow parent, | |||||
| // unused | // unused | ||||
| (void)resizable; | (void)resizable; | ||||
| (void)addToDesktop; | |||||
| (void)x11Display; | (void)x11Display; | ||||
| } | } | ||||
| @@ -9,10 +9,11 @@ include ../Makefile.mk | |||||
| # -------------------------------------------------------------- | # -------------------------------------------------------------- | ||||
| BUILD_CXX_FLAGS += -I../backend -I../includes -I../utils | BUILD_CXX_FLAGS += -I../backend -I../includes -I../utils | ||||
| # BUILD_CXX_FLAGS += -I/opt/mingw32/include | |||||
| BUILD_CXX_FLAGS += $(shell pkg-config --cflags QtCore) | BUILD_CXX_FLAGS += $(shell pkg-config --cflags QtCore) | ||||
| LINK_FLAGS += $(shell pkg-config --libs QtCore) | LINK_FLAGS += $(shell pkg-config --libs QtCore) | ||||
| TARGETS = CarlaString RtList Thread | |||||
| TARGETS = CarlaString RtList Thread GL_ | |||||
| all: $(TARGETS) RUN | all: $(TARGETS) RUN | ||||
| @@ -24,11 +25,16 @@ CarlaString: CarlaString.cpp | |||||
| RtList: RtList.cpp ../libs/rtmempool.a | RtList: RtList.cpp ../libs/rtmempool.a | ||||
| $(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -o $@ | $(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -o $@ | ||||
| Thread_: Thread.cpp | |||||
| Thread: Thread.cpp | |||||
| $(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -pthread -lpthread -o $@ | $(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) | RUN: $(TARGETS) | ||||
| ./CarlaString && ./RtList && ./Thread | |||||
| # ./CarlaString && ./RtList && ./Thread | |||||
| # ./GL | |||||
| # -------------------------------------------------------------- | # -------------------------------------------------------------- | ||||
| @@ -350,7 +350,7 @@ public: | |||||
| delete cthread; | delete cthread; | ||||
| } | } | ||||
| #else | #else | ||||
| if (pthreadId != 0) | |||||
| if (! _isNull()) | |||||
| pthread_join(pthreadId, nullptr); | pthread_join(pthreadId, nullptr); | ||||
| pthread_attr_destroy(&pthreadAttr); | pthread_attr_destroy(&pthreadAttr); | ||||
| @@ -378,9 +378,9 @@ public: | |||||
| return true; | return true; | ||||
| #else | #else | ||||
| CARLA_ASSERT(pthreadId == 0); | |||||
| CARLA_ASSERT(_isNull()); | |||||
| if (pthreadId != 0) | |||||
| if (! _isNull()) | |||||
| return false; | return false; | ||||
| return (pthread_create(&pthreadId, &pthreadAttr, _pthreadRoutine, this) == 0); | return (pthread_create(&pthreadId, &pthreadAttr, _pthreadRoutine, this) == 0); | ||||
| @@ -398,7 +398,7 @@ public: | |||||
| if (cthread == nullptr) | if (cthread == nullptr) | ||||
| return true; | return true; | ||||
| #else | #else | ||||
| if (pthreadId == 0) | |||||
| if (_isNull()) | |||||
| return true; | return true; | ||||
| #endif | #endif | ||||
| @@ -440,7 +440,7 @@ public: | |||||
| if (cthread == nullptr) | if (cthread == nullptr) | ||||
| return; | return; | ||||
| #else | #else | ||||
| if (pthreadId == 0) | |||||
| if (_isNull()) | |||||
| return; | return; | ||||
| #endif | #endif | ||||
| @@ -515,6 +515,16 @@ private: | |||||
| { | { | ||||
| ((CarlaThread*)_this_)->handleRoutine(); | ((CarlaThread*)_this_)->handleRoutine(); | ||||
| pthread_exit(nullptr); | pthread_exit(nullptr); | ||||
| return nullptr; | |||||
| } | |||||
| bool _isNull() | |||||
| { | |||||
| #ifdef Q_OS_WIN | |||||
| return pthreadId.p == nullptr; | |||||
| #else | |||||
| return pthreadId == 0; | |||||
| #endif | |||||
| } | } | ||||
| void _zero() | void _zero() | ||||
| @@ -427,7 +427,7 @@ public: | |||||
| private: | private: | ||||
| typename List<T>::Data* _allocate() | typename List<T>::Data* _allocate() | ||||
| { | { | ||||
| return (typename List<T>::Data*)malloc(this->fDataSize); | |||||
| return (typename List<T>::Data*)malloc(this->kDataSize); | |||||
| } | } | ||||
| void _deallocate(typename List<T>::Data* const dataPtr) | void _deallocate(typename List<T>::Data* const dataPtr) | ||||