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:
Tobias Doerffel
2014-07-06 13:50:49 +02:00
parent ab55b26e4b
commit 6711f5d291
3 changed files with 11 additions and 0 deletions

View File

@@ -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;

View File

@@ -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();

View File

@@ -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;