summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2013-10-10 23:43:04 +0000
committerIngo Schwarze <schwarze@openbsd.org>2013-10-10 23:43:04 +0000
commitcdce1fd8cdaeb840f17ec238602e29e861868606 (patch)
treee85b9dce5a3c96a17a12d9ea50c45d475d21e381
parentdab4dde7f1b0f095e84fccb5767b1609b7fa2758 (diff)
downloadmandoc-cdce1fd8cdaeb840f17ec238602e29e861868606.tar.gz
On __sun, use <sys/byteorder.h>, BE_64(x), and <db_185.h>.
Thanks to Thomas Klausner <wiz at NetBSD dot org> for providing failing SmartOS build logs such that i could write this patch without access to a __sun system and for confirming that these patches help.
-rw-r--r--apropos_db.c15
-rw-r--r--config.h.post3
-rw-r--r--mandocdb.c18
3 files changed, 23 insertions, 13 deletions
diff --git a/apropos_db.c b/apropos_db.c
index 28c744f0..3c48acef 100644
--- a/apropos_db.c
+++ b/apropos_db.c
@@ -30,14 +30,19 @@
#include <string.h>
#include <unistd.h>
-#if defined(__linux__)
-# include <endian.h>
-# include <db_185.h>
-#elif defined(__APPLE__)
+#if defined(__APPLE__)
# include <libkern/OSByteOrder.h>
-# include <db.h>
+#elif defined(__linux__)
+# include <endian.h>
+#elif defined(__sun)
+# include <sys/byteorder.h>
#else
# include <sys/endian.h>
+#endif
+
+#if defined(__linux__) || defined(__sun)
+# include <db_185.h>
+#else
# include <db.h>
#endif
diff --git a/config.h.post b/config.h.post
index cee82aa1..9a33671b 100644
--- a/config.h.post
+++ b/config.h.post
@@ -19,6 +19,9 @@
# if defined(__APPLE__)
# define betoh64(x) OSSwapBigToHostInt64(x)
# define htobe64(x) OSSwapHostToBigInt64(x)
+# elif defined(__sun)
+# define betoh64(x) BE_64(x)
+# define htobe64(x) BE_64(x)
# else
# define betoh64(x) be64toh(x)
# endif
diff --git a/mandocdb.c b/mandocdb.c
index 7aaf560d..cd44174c 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -34,19 +34,21 @@
#include <string.h>
#include <unistd.h>
-#if defined(__linux__) || defined(__sun)
-# include <endian.h>
-# include <db_185.h>
-#elif defined(__APPLE__)
+#if defined(__APPLE__)
# include <libkern/OSByteOrder.h>
-# include <db.h>
+#elif defined(__linux__)
+# include <endian.h>
+#elif defined(__sun)
+# include <sys/byteorder.h>
+# include <sys/stat.h>
#else
# include <sys/endian.h>
-# include <db.h>
#endif
-#if defined(__sun)
-#include <sys/stat.h>
+#if defined(__linux__) || defined(__sun)
+# include <db_185.h>
+#else
+# include <db.h>
#endif
#include "man.h"