diff --git a/libs/backends/jack/jack_audiobackend.cc b/libs/backends/jack/jack_audiobackend.cc index 8f4f1f0a78..2a9a450a2c 100644 --- a/libs/backends/jack/jack_audiobackend.cc +++ b/libs/backends/jack/jack_audiobackend.cc @@ -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 (); diff --git a/libs/pbd/cpus.cc b/libs/pbd/cpus.cc index d43591ce30..1f7e8529aa 100644 --- a/libs/pbd/cpus.cc +++ b/libs/pbd/cpus.cc @@ -35,8 +35,8 @@ #include "pbd/cpus.h" -#if defined(COMPILER_MSVC) && !defined(PTW32_VERSION) -#include // Gets us 'PTW32_VERSION' +#if defined(COMPILER_MSVC) && !defined(__PTW32_VERSION) +#include // 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; diff --git a/libs/pbd/pbd/abstract_ui.h b/libs/pbd/pbd/abstract_ui.h index de119fc238..86c12f6fb1 100644 --- a/libs/pbd/pbd/abstract_ui.h +++ b/libs/pbd/pbd/abstract_ui.h @@ -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) diff --git a/libs/pbd/pbd/debug.h b/libs/pbd/pbd/debug.h index 7efea83d11..de8058c5cd 100644 --- a/libs/pbd/pbd/debug.h +++ b/libs/pbd/pbd/debug.h @@ -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 #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 diff --git a/libs/pbd/pbd/pthread_utils.h b/libs/pbd/pbd/pthread_utils.h index 4324cde9cc..cb9d8759fe 100644 --- a/libs/pbd/pbd/pthread_utils.h +++ b/libs/pbd/pbd/pthread_utils.h @@ -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 diff --git a/libs/pbd/pthread_utils.cc b/libs/pbd/pthread_utils.cc index d2d24f38c4..f219403ddb 100644 --- a/libs/pbd/pthread_utils.cc +++ b/libs/pbd/pthread_utils.cc @@ -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); diff --git a/libs/zita-convolver/zita-convolver.cc b/libs/zita-convolver/zita-convolver.cc index ee5d13144a..f946638f3d 100644 --- a/libs/zita-convolver/zita-convolver.cc +++ b/libs/zita-convolver/zita-convolver.cc @@ -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; diff --git a/libs/zita-convolver/zita-convolver/zita-convolver.h b/libs/zita-convolver/zita-convolver/zita-convolver.h index 1b0e6ca3f9..4966872e09 100644 --- a/libs/zita-convolver/zita-convolver/zita-convolver.h +++ b/libs/zita-convolver/zita-convolver/zita-convolver.h @@ -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 #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 { diff --git a/msvc_extra_headers/ardourext/ptw32/pthread.h.input b/msvc_extra_headers/ardourext/ptw32/pthread.h.input index 3ac3e174f8..3232d4e257 100644 --- a/msvc_extra_headers/ardourext/ptw32/pthread.h.input +++ b/msvc_extra_headers/ardourext/ptw32/pthread.h.input @@ -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