blob: efae564842279c9a13c7149239f03b4a6e9239f2 (
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
|
$NetBSD: patch-src_third__party_s2_base_port.h,v 1.1 2019/06/28 16:30:56 gdt Exp $
* Add NetBSD support.
--- src/third_party/s2/base/port.h.orig 2016-01-05 18:31:44.000000000 +0000
+++ src/third_party/s2/base/port.h
@@ -102,7 +102,7 @@ typedef uint16_t u_int16_t;
#endif
-#if defined __sun || defined __FreeBSD__ || defined __OpenBSD__
+#if defined __sun || defined __FreeBSD__ || defined __OpenBSD__ || defined __DragonFly__ || defined __NetBSD__
#ifdef _LITTLE_ENDIAN
#define IS_LITTLE_ENDIAN
#elif defined _BIG_ENDIAN
@@ -139,6 +139,11 @@ typedef uint16_t u_int16_t;
#define bswap_16(x) swap16(x)
#define bswap_32(x) swap32(x)
#define bswap_64(x) swap64(x)
+#elif defined __NetBSD__
+#include <machine/bswap.h>
+#define bswap_16(x) bswap16(x)
+#define bswap_32(x) bswap32(x)
+#define bswap_64(x) bswap64(x)
#else
#include <byteswap.h>
#endif
|