Browse Source

Fix build on Haiku OS

tags/v2.1-alpha1-winvst
falkTX 6 years ago
parent
commit
582f4d5622
4 changed files with 6 additions and 6 deletions
  1. +0
    -2
      source/Makefile.mk
  2. +1
    -1
      source/modules/rtaudio/RtAudio.cpp
  3. +1
    -1
      source/modules/rtaudio/RtAudio.h
  4. +4
    -2
      source/utils/CarlaThread.hpp

+ 0
- 2
source/Makefile.mk View File

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


+ 1
- 1
source/modules/rtaudio/RtAudio.cpp View File

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


+ 1
- 1
source/modules/rtaudio/RtAudio.h View File

@@ -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 <pthread.h>



+ 4
- 2
source/utils/CarlaThread.hpp View File

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


Loading…
Cancel
Save