summaryrefslogtreecommitdiff
path: root/debian/patches/dyson-endian.patch
blob: 765ee80b351a240d36d4005c9a299060c779f195 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Index: knot/src/libknot/util/endian.h
===================================================================
--- knot.orig/src/libknot/util/endian.h	2014-05-24 14:03:58.309271227 +0400
+++ knot/src/libknot/util/endian.h	2014-05-24 18:36:14.148607917 +0400
@@ -46,6 +46,17 @@
 #       define htobe16(x) OSSwapHostToBigInt16(x)
 #       define htobe32(x) OSSwapHostToBigInt32(x)
 #       define htobe64(x) OSSwapHostToBigInt64(x)
+#elif defined(__sun__)
+#   ifndef __EXTENSIONS__
+#     define __EXTENSIONS__ 1
+#   endif
+#   include <sys/byteorder.h>
+#   define be16toh(x) ntohs(x)
+#   define be32toh(x) ntohl(x)
+#   define be64toh(x) ntohll(x)
+#   define htobe16(x) htons(x)
+#   define htobe32(x) htonl(x)
+#   define htobe64(x) htonll(x)
 #endif
 
 #endif /* _KNOT_ENDIAN_H_ */