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.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <lmmsconfig.h>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <ctime>
|
||||
|
||||
#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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user