summaryrefslogtreecommitdiff
path: root/multimedia/libmpeg3/patches/patch-ac
blob: c01b07c4207d29e60bc9c34b55ed1f202f314ab3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
$NetBSD: patch-ac,v 1.5 2009/01/29 17:53:49 abs Exp $

--- mpeg3ifo.c.orig	2007-12-16 23:25:26.000000000 +0000
+++ mpeg3ifo.c
@@ -1,4 +1,3 @@
-#include <byteswap.h>
 #include <dirent.h>
 #include <fcntl.h>
 #include <stdlib.h>
@@ -10,6 +9,23 @@
 #include "mpeg3private.h"
 #include "mpeg3protos.h"
 
+#if defined(__NetBSD__)
+#  include <sys/endian.h>
+#  include <machine/bswap.h>
+#  define bswap_16(x) bswap16(x)
+#  define bswap_32(x) bswap32(x)
+#elif defined(__DragonFly__)
+#  include <sys/endian.h>
+#  define bswap_16(x) bswap16(x)
+#  define bswap_32(x) bswap32(x)
+#elif defined(linux)
+#  include <byteswap.h>
+#elif defined(__APPLE__) || defined(__MACH__) /* MacOS X */
+#  include <libkern/OSByteOrder.h>
+#  define bswap_16(x) OSSwapInt16(x)
+#  define bswap_32(x) OSSwapInt32(x)
+#endif
+
 typedef struct
 {
 // Bytes relative to start of stream.