aboutsummaryrefslogtreecommitdiff
path: root/audio/fluidsynth/files/patch-src_bindings_fluid__rtkit.c
diff options
context:
space:
mode:
Diffstat (limited to 'audio/fluidsynth/files/patch-src_bindings_fluid__rtkit.c')
-rw-r--r--audio/fluidsynth/files/patch-src_bindings_fluid__rtkit.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/audio/fluidsynth/files/patch-src_bindings_fluid__rtkit.c b/audio/fluidsynth/files/patch-src_bindings_fluid__rtkit.c
new file mode 100644
index 000000000000..2a36fb3bd018
--- /dev/null
+++ b/audio/fluidsynth/files/patch-src_bindings_fluid__rtkit.c
@@ -0,0 +1,39 @@
+--- src/bindings/fluid_rtkit.c.orig 2012-08-16 04:01:13 UTC
++++ src/bindings/fluid_rtkit.c
+@@ -34,7 +34,7 @@
+ #include "fluid_rtkit.h"
+
+
+-#if defined(__linux__) || defined(__APPLE__)
++#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
+
+ #ifndef _GNU_SOURCE
+ #define _GNU_SOURCE
+@@ -44,12 +44,27 @@
+ #include <string.h>
+ #include <unistd.h>
+ #include <sys/types.h>
++#include <sys/time.h>
+ #include <sys/syscall.h>
+ #include <sys/resource.h>
++#include <sys/param.h>
+
++#if defined(__FreeBSD__)
++#include <pthread_np.h>
++#endif
+
+ static pid_t _gettid(void) {
++#if defined(__FreeBSD__)
++#if __FreeBSD__version > 900030
++ return pthread_getthreadid_np();
++#else
++ long tid;
++ syscall(SYS_thr_self, &tid);
++ return tid;
++#endif
++#else
+ return (pid_t) syscall(SYS_gettid);
++#endif
+ }
+
+ static int translate_error(const char *name) {