mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-05 22:34:56 +01:00
Use compiler provided PTW_VERSION define for compatibility
This commit is contained in:
parent
b938daca95
commit
728558e51c
9 changed files with 20 additions and 20 deletions
|
|
@ -846,7 +846,7 @@ JACKAudioBackend::join_process_threads ()
|
|||
bool
|
||||
JACKAudioBackend::in_process_thread ()
|
||||
{
|
||||
#if defined COMPILER_MINGW && (!defined PTW32_VERSION || defined __jack_systemdeps_h__)
|
||||
#if defined COMPILER_MINGW && (!defined __PTW32_VERSION || defined __jack_systemdeps_h__)
|
||||
if (_main_thread == GetCurrentThread()) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -858,7 +858,7 @@ JACKAudioBackend::in_process_thread ()
|
|||
|
||||
for (auto & thread : _jack_threads) {
|
||||
|
||||
#if defined COMPILER_MINGW && (!defined PTW32_VERSION || defined __jack_systemdeps_h__)
|
||||
#if defined COMPILER_MINGW && (!defined __PTW32_VERSION || defined __jack_systemdeps_h__)
|
||||
if (thread == GetCurrentThread()) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -909,7 +909,7 @@ JACKAudioBackend::process_thread ()
|
|||
/* JACK doesn't do this for us when we use the wait API
|
||||
*/
|
||||
|
||||
#if defined COMPILER_MINGW && (!defined PTW32_VERSION || defined __jack_systemdeps_h__)
|
||||
#if defined COMPILER_MINGW && (!defined __PTW32_VERSION || defined __jack_systemdeps_h__)
|
||||
_main_thread = GetCurrentThread();
|
||||
#else
|
||||
_main_thread = pthread_self ();
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@
|
|||
|
||||
#include "pbd/cpus.h"
|
||||
|
||||
#if defined(COMPILER_MSVC) && !defined(PTW32_VERSION)
|
||||
#include <ardourext/pthread.h> // Gets us 'PTW32_VERSION'
|
||||
#if defined(COMPILER_MSVC) && !defined(__PTW32_VERSION)
|
||||
#include <ardourext/pthread.h> // Gets us '__PTW32_VERSION'
|
||||
#endif
|
||||
|
||||
int32_t
|
||||
|
|
@ -69,7 +69,7 @@ PBD::hardware_concurrency()
|
|||
return c;
|
||||
}
|
||||
}
|
||||
#if defined(PTW32_VERSION) || defined(__hpux)
|
||||
#if defined(__PTW32_VERSION) || defined(__hpux)
|
||||
return pthread_num_processors_np();
|
||||
#elif defined(__APPLE__)
|
||||
int count;
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ protected:
|
|||
};
|
||||
typedef typename RequestBuffer::rw_vector RequestBufferVector;
|
||||
|
||||
#if defined(COMPILER_MINGW) && defined(PTW32_VERSION)
|
||||
#if defined(COMPILER_MINGW) && defined(__PTW32_VERSION)
|
||||
struct pthread_cmp
|
||||
{
|
||||
bool operator() (const ptw32_handle_t& thread1, const ptw32_handle_t& thread2)
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
#include "pbd/libpbd_visibility.h"
|
||||
#include "pbd/timing.h"
|
||||
|
||||
/* check for PTW32_VERSION */
|
||||
/* check for __PTW32_VERSION */
|
||||
#ifdef COMPILER_MSVC
|
||||
#include <ardourext/pthread.h>
|
||||
#else
|
||||
|
|
@ -83,7 +83,7 @@ namespace PBD {
|
|||
#define DEBUG_STR(id) __debug_str ## id
|
||||
#define DEBUG_STR_APPEND(id,s) __debug_str ## id << s;
|
||||
#define DEBUG_ENABLED(bits) (((bits) & PBD::debug_bits).any())
|
||||
#ifdef PTW32_VERSION
|
||||
#ifdef __PTW32_VERSION
|
||||
#define DEBUG_THREAD_SELF pthread_self().p
|
||||
#define DEBUG_THREAD_PRINT(t) t.p
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -27,13 +27,13 @@
|
|||
*/
|
||||
#ifndef PTHREAD_MACROS_DEFINED
|
||||
#define PTHREAD_MACROS_DEFINED
|
||||
#ifdef PTW32_VERSION /* pthread_win32 */
|
||||
#ifdef __PTW32_VERSION /* pthread_win32 */
|
||||
#define mark_pthread_inactive(threadID) threadID.p=0
|
||||
#define is_pthread_active(threadID) (threadID.p!=0)
|
||||
#else /* normal pthread */
|
||||
#define mark_pthread_inactive(threadID) threadID=0
|
||||
#define is_pthread_active(threadID) threadID!=0
|
||||
#endif /* PTW32_VERSION */
|
||||
#endif /* __PTW32_VERSION */
|
||||
#endif /* PTHREAD_MACROS_DEFINED */
|
||||
|
||||
#ifdef COMPILER_MSVC
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ pthread_set_name (const char* str)
|
|||
/* copy string and delete it when exiting */
|
||||
thread_name.set (strdup (str)); // leaks
|
||||
|
||||
#if !defined PTW32_VERSION && defined _GNU_SOURCE
|
||||
#if !defined __PTW32_VERSION && defined _GNU_SOURCE
|
||||
/* set public thread name, up to 16 chars */
|
||||
char ptn[16];
|
||||
memset (ptn, 0, 16);
|
||||
|
|
|
|||
|
|
@ -433,7 +433,7 @@ Convlevel::Convlevel (void)
|
|||
, _npar (0)
|
||||
, _parsize (0)
|
||||
, _options (0)
|
||||
#ifndef PTW32_VERSION
|
||||
#ifndef __PTW32_VERSION
|
||||
, _pthr (0)
|
||||
#endif
|
||||
, _inp_list (0)
|
||||
|
|
@ -608,7 +608,7 @@ Convlevel::start (int abspri, int policy)
|
|||
pthread_attr_t attr;
|
||||
struct sched_param parm;
|
||||
|
||||
#ifndef PTW32_VERSION
|
||||
#ifndef __PTW32_VERSION
|
||||
_pthr = 0;
|
||||
#endif
|
||||
min = sched_get_priority_min (policy);
|
||||
|
|
@ -686,7 +686,7 @@ void*
|
|||
Convlevel::static_main (void* arg)
|
||||
{
|
||||
((Convlevel*)arg)->main ();
|
||||
#if !defined PTW32_VERSION && defined _GNU_SOURCE
|
||||
#if !defined __PTW32_VERSION && defined _GNU_SOURCE
|
||||
pthread_setname_np (pthread_self(), "ZConvlevel");
|
||||
#endif
|
||||
return 0;
|
||||
|
|
@ -700,7 +700,7 @@ Convlevel::main (void)
|
|||
_trig.wait ();
|
||||
if (_stat == ST_TERM) {
|
||||
_stat = ST_IDLE;
|
||||
#ifndef PTW32_VERSION
|
||||
#ifndef __PTW32_VERSION
|
||||
_pthr = 0;
|
||||
#endif
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#include "zita-convolver/zconvolver_visibility.h"
|
||||
|
||||
#if defined(__linux__) || defined(__GNU__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(PTW32_VERSION) || defined(__WINPTHREADS_VERSION)
|
||||
#if defined(__linux__) || defined(__GNU__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__PTW32_VERSION) || defined(__WINPTHREADS_VERSION)
|
||||
#include <semaphore.h>
|
||||
#endif
|
||||
|
||||
|
|
@ -38,7 +38,7 @@ namespace ArdourZita {
|
|||
#endif
|
||||
|
||||
/* note: mingw and msvc actually use PTW32's implementation of semaphores */
|
||||
#if defined(__linux__) || defined(__GNU__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(PTW32_VERSION) || defined (__WINPTHREADS_VERSION)
|
||||
#if defined(__linux__) || defined(__GNU__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__PTW32_VERSION) || defined (__WINPTHREADS_VERSION)
|
||||
|
||||
class LIBZCONVOLVER_API ZCsema
|
||||
{
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@
|
|||
* See the README file for an explanation of the pthreads-win32 version
|
||||
* numbering scheme and how the DLL is named etc.
|
||||
*/
|
||||
#define PTW32_VERSION 2,9,1,0
|
||||
#define PTW32_VERSION_STRING "2, 9, 1, 0\0"
|
||||
#define __PTW32_VERSION 2,9,1,0
|
||||
#define __PTW32_VERSION_STRING "2, 9, 1, 0\0"
|
||||
|
||||
/* There are three implementations of cancel cleanup.
|
||||
* Note that pthread.h is included in both application
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue