summaryrefslogtreecommitdiff
path: root/emulators/darcnes/patches/patch-ad
blob: 4793e32327490304c5875c451f839aa6abe3a180 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
$NetBSD: patch-ad,v 1.1 2000/02/14 02:44:36 wiz Exp $

--- ./endian.h.orig	Mon Feb 14 03:05:25 2000
+++ ./endian.h	Mon Feb 14 02:38:38 2000
@@ -0,0 +1,41 @@
+#ifndef __HAD_MY_ENDIAN_H
+#define __HAD_MY_ENDIAN_H
+
+#include <sys/param.h>
+
+#if (defined(BSD) && (BSD >= 199306))
+/* this should filter out NetBSD, FreeBSD and OpenBSD */
+#include <machine/endian.h>
+
+#if BYTE_ORDER == BIG_ENDIAN
+#define MSB_FIRST 1
+#undef LSB_FIRST
+#else
+#define LSB_FIRST 1
+#undef MSB_FIRST
+#endif
+
+#else
+/* for Linux, perhaps use #ifdef __linux__? */
+#include <sys/types.h>
+
+#if defined(__BYTE_ORDER)
+#if __BYTE_ORDER == __BIG_ENDIAN
+#define MSB_FIRST 1
+#undef LSB_FIRST
+#else
+#define LSB_FIRST 1
+#undef MSB_FIRST
+#endif /* __BYTE_ORDER == __BIG_ENDIAN */
+
+#else /* defined(__BYTE_ORDER) */
+
+/* not Linux, either, just set it to LSB */
+#define LSB_FIRST 1
+#undef MSB_FIRST
+
+#endif /* defined(__BYTE_ORDER) */
+
+#endif /* defined(BSD) && (BSD >= 199306) */
+
+#endif /* __HAD_MY_ENDIAN_H */