Browse Source

Fix build on Haiku OS

tags/v1.9.12
falkTX 7 years ago
parent
commit
1ad96dc51e
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

@@ -454,8 +454,6 @@ JACKBRIDGE_LIBS = -lpthread
LILV_LIBS = -lm LILV_LIBS = -lm
RTMEMPOOL_LIBS = -lpthread RTMEMPOOL_LIBS = -lpthread
WATER_LIBS = -lpthread WATER_LIBS = -lpthread
RTAUDIO_FLAGS += -D__RTAUDIO_DUMMY__
RTMIDI_FLAGS += -D__RTMIDI_DUMMY__
endif endif


ifeq ($(HURD),true) ifeq ($(HURD),true)


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

@@ -76,7 +76,7 @@ const unsigned int RtApi::SAMPLE_RATES[] = {
return s; 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 // pthread API
#define MUTEX_INITIALIZE(A) pthread_mutex_init(A, NULL) #define MUTEX_INITIALIZE(A) pthread_mutex_init(A, NULL)
#define MUTEX_DESTROY(A) pthread_mutex_destroy(A) #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 uintptr_t ThreadHandle;
typedef CRITICAL_SECTION StreamMutex; 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. // Using pthread library for various flavors of unix.
#include <pthread.h> #include <pthread.h>




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

@@ -103,17 +103,19 @@ public:
{ {
sched_param.sched_priority = 80; sched_param.sched_priority = 80;


#ifndef CARLA_OS_HAIKU
if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM) == 0 && if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM) == 0 &&
pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED) == 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_FIFO) == 0 ||
pthread_attr_setschedpolicy(&attr, SCHED_RR) == 0) && pthread_attr_setschedpolicy(&attr, SCHED_RR) == 0) &&
#endif
# endif
pthread_attr_setschedparam(&attr, &sched_param) == 0) pthread_attr_setschedparam(&attr, &sched_param) == 0)
{ {
carla_stdout("CarlaThread with realtime priority successful"); carla_stdout("CarlaThread with realtime priority successful");
} }
else else
#endif
{ {
carla_stdout("CarlaThread with realtime priority failed, going with normal priority instead"); carla_stdout("CarlaThread with realtime priority failed, going with normal priority instead");
pthread_attr_destroy(&attr); pthread_attr_destroy(&attr);


Loading…
Cancel
Save