From 6711f5d2914294fc7b9ed39804da0fd96a5f1ab2 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sun, 6 Jul 2014 13:50:49 +0200 Subject: [PATCH] Added support for winpthreads library Recent builds of MinGW64 runtime include the winpthreads library which is not linked statically anymore and thus doesn't required non-portable (de-)initialization function calls. --- plugins/vst_base/RemoteVstPlugin.cpp | 4 ++++ plugins/zynaddsubfx/LocalZynAddSubFx.cpp | 3 +++ plugins/zynaddsubfx/RemoteZynAddSubFx.cpp | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/plugins/vst_base/RemoteVstPlugin.cpp b/plugins/vst_base/RemoteVstPlugin.cpp index ef85fbd48..cc441ce77 100644 --- a/plugins/vst_base/RemoteVstPlugin.cpp +++ b/plugins/vst_base/RemoteVstPlugin.cpp @@ -1860,10 +1860,12 @@ int main( int _argc, char * * _argv ) } #ifdef LMMS_BUILD_WIN32 +#ifndef __WINPTHREADS_VERSION // (non-portable) initialization of statically linked pthread library pthread_win32_process_attach_np(); pthread_win32_thread_attach_np(); #endif +#endif #ifdef LMMS_BUILD_LINUX #ifdef LMMS_HAVE_SCHED_H @@ -1897,8 +1899,10 @@ int main( int _argc, char * * _argv ) #ifdef LMMS_BUILD_WIN32 +#ifndef __WINPTHREADS_VERSION pthread_win32_thread_detach_np(); pthread_win32_process_detach_np(); +#endif #endif return 0; diff --git a/plugins/zynaddsubfx/LocalZynAddSubFx.cpp b/plugins/zynaddsubfx/LocalZynAddSubFx.cpp index 05b6a725e..586481b82 100644 --- a/plugins/zynaddsubfx/LocalZynAddSubFx.cpp +++ b/plugins/zynaddsubfx/LocalZynAddSubFx.cpp @@ -25,6 +25,7 @@ #include #include +#include #include "LocalZynAddSubFx.h" @@ -46,9 +47,11 @@ LocalZynAddSubFx::LocalZynAddSubFx() if( s_instanceCount == 0 ) { #ifdef LMMS_BUILD_WIN32 +#ifndef __WINPTHREADS_VERSION // (non-portable) initialization of statically linked pthread library pthread_win32_process_attach_np(); pthread_win32_thread_attach_np(); +#endif #endif initConfig(); diff --git a/plugins/zynaddsubfx/RemoteZynAddSubFx.cpp b/plugins/zynaddsubfx/RemoteZynAddSubFx.cpp index e769594fa..2e4535d73 100644 --- a/plugins/zynaddsubfx/RemoteZynAddSubFx.cpp +++ b/plugins/zynaddsubfx/RemoteZynAddSubFx.cpp @@ -263,10 +263,12 @@ int main( int _argc, char * * _argv ) } #ifdef LMMS_BUILD_WIN32 +#ifndef __WINPTHREADS_VERSION // (non-portable) initialization of statically linked pthread library pthread_win32_process_attach_np(); pthread_win32_thread_attach_np(); #endif +#endif RemoteZynAddSubFx * remoteZASF = @@ -278,8 +280,10 @@ int main( int _argc, char * * _argv ) #ifdef LMMS_BUILD_WIN32 +#ifndef __WINPTHREADS_VERSION pthread_win32_thread_detach_np(); pthread_win32_process_detach_np(); +#endif #endif return 0;