Skip to content

Commit

Permalink
Fix Unbound build on Solaris and AIX
Browse files Browse the repository at this point in the history
  • Loading branch information
noloader committed May 4, 2019
1 parent 478dad9 commit 7840fb1
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions patch/unbound.patch
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,23 @@
#endif

/** Use small-ldns codebase */
--- cachedb/cachedb.c
+++ cachedb/cachedb.c
@@ -72,6 +72,17 @@
# define be64toh(x) OSSwapBigToHostInt64(x)
#endif

+/* Some compilers do not define __BYTE_ORDER__, like IBM XLC on AIX */
+#if defined(__sun) || defined(_AIX)
+# if __BIG_ENDIAN__
+# define be64toh(n) (n)
+# define htobe64(n) (n)
+# else
+# define be64toh(n) (((uint64_t)htonl((n) & 0xFFFFFFFF) << 32) | htonl((n) >> 32))
+# define htobe64(n) (((uint64_t)htonl((n) & 0xFFFFFFFF) << 32) | htonl((n) >> 32))
+# endif
+#endif
+
/** the unit test testframe for cachedb, its module state contains
* a cache for a couple queries (in memory). */
struct testframe_moddata {

0 comments on commit 7840fb1

Please sign in to comment.