summaryrefslogtreecommitdiffstats
path: root/osdep
diff options
context:
space:
mode:
Diffstat (limited to 'osdep')
-rw-r--r--osdep/Makefile1
-rw-r--r--osdep/shmem.c2
-rw-r--r--osdep/swab.c17
-rw-r--r--osdep/timer-lx.c3
4 files changed, 23 insertions, 0 deletions
diff --git a/osdep/Makefile b/osdep/Makefile
index 4052aa4cd7..58370bc628 100644
--- a/osdep/Makefile
+++ b/osdep/Makefile
@@ -4,6 +4,7 @@ include ../config.mak
LIBNAME = libosdep.a
SRCS= shmem.c strsep.c strl.c vsscanf.c scandir.c gettimeofday.c fseeko.c \
+ swab.c
# timer.c
ifeq ($(TARGET_ARCH_X86),yes)
diff --git a/osdep/shmem.c b/osdep/shmem.c
index 9426a33fd5..ec496d92f1 100644
--- a/osdep/shmem.c
+++ b/osdep/shmem.c
@@ -20,6 +20,8 @@
#include <sys/uio.h>
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
+#elif defined(__BEOS__)
+#include <mman.h>
#endif
#include <sys/socket.h>
#include <fcntl.h>
diff --git a/osdep/swab.c b/osdep/swab.c
new file mode 100644
index 0000000000..45d26cbc14
--- /dev/null
+++ b/osdep/swab.c
@@ -0,0 +1,17 @@
+#include "../config.h"
+
+#ifndef HAVE_SWAB
+/* system has no swab. emulate via bswap */
+#include "../bswap.h"
+#include <unistd.h>
+
+void swab(const void *from, void *to, ssize_t n) {
+ const int16_t *in = (int16_t*)from;
+ int16_t *out = (int16_t*)to;
+ int i;
+ n /= 2;
+ for (i = 0 ; i < n; i++) {
+ out[i] = bswap_16(in[i]);
+ }
+}
+#endif
diff --git a/osdep/timer-lx.c b/osdep/timer-lx.c
index f7deb98dda..e0ecfb6e58 100644
--- a/osdep/timer-lx.c
+++ b/osdep/timer-lx.c
@@ -1,6 +1,9 @@
// Precise timer routines for LINUX (C) LGB & A'rpi/ASTRAL
#include <unistd.h>
+#ifdef __BEOS__
+#define usleep(t) snooze(t)
+#endif
#include <stdlib.h>
#include <time.h>
#include <sys/time.h>