summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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"