From 582f4d56227f71bcfee59f25d66b497d2c3db7a3 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 29 Sep 2018 21:08:33 +0200 Subject: [PATCH] Fix build on Haiku OS --- source/Makefile.mk | 2 -- source/modules/rtaudio/RtAudio.cpp | 2 +- source/modules/rtaudio/RtAudio.h | 2 +- source/utils/CarlaThread.hpp | 6 ++++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/Makefile.mk b/source/Makefile.mk index 45abeb42b..758f28268 100644 --- a/source/Makefile.mk +++ b/source/Makefile.mk @@ -456,8 +456,6 @@ JACKBRIDGE_LIBS = -lpthread LILV_LIBS = -lm RTMEMPOOL_LIBS = -lpthread WATER_LIBS = -lpthread -RTAUDIO_FLAGS += -D__RTAUDIO_DUMMY__ -RTMIDI_FLAGS += -D__RTMIDI_DUMMY__ endif ifeq ($(HURD),true) diff --git a/source/modules/rtaudio/RtAudio.cpp b/source/modules/rtaudio/RtAudio.cpp index 9810557ec..474a96436 100644 --- a/source/modules/rtaudio/RtAudio.cpp +++ b/source/modules/rtaudio/RtAudio.cpp @@ -76,7 +76,7 @@ const unsigned int RtApi::SAMPLE_RATES[] = { return s; } -#elif defined(__LINUX_ALSA__) || defined(__UNIX_PULSE__) || defined(__UNIX_JACK__) || defined(__LINUX_OSS__) || defined(__MACOSX_CORE__) +#elif defined(__LINUX_ALSA__) || defined(__UNIX_PULSE__) || defined(__UNIX_JACK__) || defined(__LINUX_OSS__) || defined(__MACOSX_CORE__) || defined(__HAIKU__) // pthread API #define MUTEX_INITIALIZE(A) pthread_mutex_init(A, NULL) #define MUTEX_DESTROY(A) pthread_mutex_destroy(A) diff --git a/source/modules/rtaudio/RtAudio.h b/source/modules/rtaudio/RtAudio.h index cd24ec600..289e254c1 100644 --- a/source/modules/rtaudio/RtAudio.h +++ b/source/modules/rtaudio/RtAudio.h @@ -593,7 +593,7 @@ class RTAUDIO_DLL_PUBLIC RtAudio typedef uintptr_t ThreadHandle; typedef CRITICAL_SECTION StreamMutex; -#elif defined(__LINUX_ALSA__) || defined(__UNIX_PULSE__) || defined(__UNIX_JACK__) || defined(__LINUX_OSS__) || defined(__MACOSX_CORE__) +#elif defined(__LINUX_ALSA__) || defined(__UNIX_PULSE__) || defined(__UNIX_JACK__) || defined(__LINUX_OSS__) || defined(__MACOSX_CORE__) || defined(__HAIKU__) // Using pthread library for various flavors of unix. #include diff --git a/source/utils/CarlaThread.hpp b/source/utils/CarlaThread.hpp index b17c5d5f7..9b5062155 100644 --- a/source/utils/CarlaThread.hpp +++ b/source/utils/CarlaThread.hpp @@ -103,17 +103,19 @@ public: { sched_param.sched_priority = 80; +#ifndef CARLA_OS_HAIKU if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM) == 0 && pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED) == 0 && -#ifndef CARLA_OS_WIN +# ifndef CARLA_OS_WIN (pthread_attr_setschedpolicy(&attr, SCHED_FIFO) == 0 || pthread_attr_setschedpolicy(&attr, SCHED_RR) == 0) && -#endif +# endif pthread_attr_setschedparam(&attr, &sched_param) == 0) { carla_stdout("CarlaThread with realtime priority successful"); } else +#endif { carla_stdout("CarlaThread with realtime priority failed, going with normal priority instead"); pthread_attr_destroy(&attr);