From 010c0d38a54c7da2deeeb9efdfaf7239172caf7d Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Thu, 2 Jan 2020 21:16:37 +0300
Subject: disable setlocale for haiku


diff --git a/player/main.c b/player/main.c
index e039f61..b4e941c 100644
--- a/player/main.c
+++ b/player/main.c
@@ -235,6 +235,7 @@ static bool check_locale(void)
 
 struct MPContext *mp_create(void)
 {
+#ifndef __HAIKU__
     if (!check_locale()) {
         // Normally, we never print anything (except if the "terminal" option
         // is enabled), so this is an exception.
@@ -242,7 +243,7 @@ struct MPContext *mp_create(void)
                         "Call 'setlocale(LC_NUMERIC, \"C\");' in your code.\n");
         return NULL;
     }
-
+#endif
     char *enable_talloc = getenv("MPV_LEAK_REPORT");
     if (!enable_talloc)
         enable_talloc = HAVE_TA_LEAK_REPORT ? "1" : "0";
-- 
2.30.2


From 4b9b3b1d07674b92d371ee3c784571ad82459f5f Mon Sep 17 00:00:00 2001
From: Sergei Reznikov <diver@gelios.net>
Date: Tue, 2 Nov 2021 12:19:55 +0300
Subject: Fix build on Haiku


diff --git a/common/stats.c b/common/stats.c
index ce50bdc..79f1343 100644
--- a/common/stats.c
+++ b/common/stats.c
@@ -69,7 +69,7 @@ struct stat_entry {
 // Overflows only after I'm dead.
 static int64_t get_thread_cpu_time_ns(pthread_t thread)
 {
-#if defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0 && defined(_POSIX_THREAD_CPUTIME)
+#if defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0 && defined(_POSIX_THREAD_CPUTIME) && !defined(__HAIKU__)
     clockid_t id;
     struct timespec tv;
     if (pthread_getcpuclockid(thread, &id) == 0 &&
-- 
2.30.2

