mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
First batch of change of waf/MSVC specific changes from EZ4Stephen
This commit is contained in:
parent
e29523ab52
commit
4998b114ea
7 changed files with 24 additions and 9 deletions
|
|
@ -15,6 +15,9 @@
|
|||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
#ifdef COMPILER_MSVC
|
||||
#define _USE_MATH_DEFINES
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,10 @@
|
|||
#include <cerrno>
|
||||
#include <cstring>
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
#include <winsock2.h>
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
#define PTHREAD_MACROS_DEFINED
|
||||
#ifdef PTW32_VERSION /* pthread_win32 */
|
||||
#define mark_pthread_inactive(threadID) threadID.p=0
|
||||
#define is_pthread_active(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
|
||||
|
|
|
|||
|
|
@ -18,7 +18,9 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
namespace PBD {
|
||||
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ fake_thread_start (void* arg)
|
|||
pthread_mutex_lock (&thread_map_lock);
|
||||
|
||||
for (auto const& t : all_threads) {
|
||||
if (pthread_equal (t.first, pthread_self ())) {
|
||||
if (pthread_equal (t.first, pthread_self ()) != 0) {
|
||||
DEBUG_TRACE (PBD::DEBUG::Threads, string_compose ("Terminated: '%1'\n", t.second));
|
||||
all_threads.erase (t.first);
|
||||
break;
|
||||
|
|
@ -262,7 +262,7 @@ pthread_kill_all (int signum)
|
|||
{
|
||||
pthread_mutex_lock (&thread_map_lock);
|
||||
for (auto const& t : all_threads) {
|
||||
if (pthread_equal (t.first, pthread_self ())) {
|
||||
if (pthread_equal (t.first, pthread_self ()) != 0) {
|
||||
continue;
|
||||
}
|
||||
DEBUG_TRACE (PBD::DEBUG::Threads, string_compose ("Kill: '%1'\n", t.second));
|
||||
|
|
@ -277,7 +277,7 @@ pthread_cancel_all ()
|
|||
{
|
||||
pthread_mutex_lock (&thread_map_lock);
|
||||
for (auto const& t : all_threads) {
|
||||
if (pthread_equal (t.first, pthread_self ())) {
|
||||
if (pthread_equal (t.first, pthread_self ()) != 0) {
|
||||
continue;
|
||||
}
|
||||
DEBUG_TRACE (PBD::DEBUG::Threads, string_compose ("Cancel: '%1'\n", t.second));
|
||||
|
|
@ -292,7 +292,7 @@ pthread_cancel_one (pthread_t thread)
|
|||
{
|
||||
pthread_mutex_lock (&thread_map_lock);
|
||||
for (auto const& t : all_threads) {
|
||||
if (pthread_equal (t.first, thread)) {
|
||||
if (pthread_equal (t.first, thread) != 0) {
|
||||
all_threads.erase (t.first);
|
||||
break;
|
||||
}
|
||||
|
|
@ -443,7 +443,7 @@ pbd_set_thread_priority (pthread_t thread, int policy, int priority)
|
|||
DEBUG_TRACE (PBD::DEBUG::Threads, string_compose ("Change '%1' to policy = %2 priority = %3\n", pthread_name(), policy, param.sched_priority));
|
||||
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
if (is_pthread_active (thread) && param.sched_priority >= 12) {
|
||||
if (thread.p != 0 && param.sched_priority >= 12) {
|
||||
if (set_win_set_realtime_policy (thread, param.sched_priority)) {
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -588,7 +588,7 @@ PBD::Thread::_run (void* arg)
|
|||
/* cleanup */
|
||||
pthread_mutex_lock (&thread_map_lock);
|
||||
for (auto const& t : all_threads) {
|
||||
if (pthread_equal (t.first, pthread_self ())) {
|
||||
if (pthread_equal (t.first, pthread_self ()) != 0) {
|
||||
DEBUG_TRACE (PBD::DEBUG::Threads, string_compose ("Terminated: '%1'\n", t.second));
|
||||
all_threads.erase (t.first);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -18,14 +18,17 @@
|
|||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <algorithm>
|
||||
|
||||
#include <assert.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifndef COMPILER_MSVC
|
||||
#include <dirent.h>
|
||||
|
|
|
|||
|
|
@ -23,6 +23,10 @@
|
|||
|
||||
#include "pbd/windows_special_dirs.h"
|
||||
|
||||
#if defined (COMPILER_MSVC) && !defined (PATH_MAX)
|
||||
#define PATH_MAX _MAX_PATH
|
||||
#endif
|
||||
|
||||
std::string
|
||||
PBD::get_win_special_folder_path (int csidl)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue