summaryrefslogtreecommitdiff
path: root/multimedia/libmpeg3/patches/patch-ac
blob: af58881aaba8db9d1bc791116531af6b869b0419 (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
$NetBSD: patch-ac,v 1.3 2005/07/13 13:16:36 wiz Exp $

--- mpeg3ifo.c.orig	2001-05-20 05:05:26.000000000 +0200
+++ mpeg3ifo.c
@@ -1,10 +1,26 @@
-#include <byteswap.h>
 #include <dirent.h>
 #include <fcntl.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sys/types.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
+
 #include "ifo.h"
 #include "mpeg3private.h"
 #include "mpeg3protos.h"