summaryrefslogtreecommitdiffstats
path: root/mandocdb.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-12-02 00:21:56 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-12-02 00:21:56 +0000
commitd1b540afdd77328cb66da01be9399236630bf4f6 (patch)
tree9d982aae078b2e6b5d1588748ab8dfb5200f77d8 /mandocdb.c
parenta6c0706435e0555aa583406662a52bc89aa8c926 (diff)
downloadmandoc-d1b540afdd77328cb66da01be9399236630bf4f6.tar.gz
This is a little gross: Linux and Apple need lots some cajoling to work
with byte-swapping. Tested on Mac. Any Linux machines somebody can test on? Anybody? While here, note the correct byte-size in mandocdb(8) and also note field widths and endianness. The btree is now endian-neutral.
Diffstat (limited to 'mandocdb.c')
-rw-r--r--mandocdb.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mandocdb.c b/mandocdb.c
index 66703f23..2c03da2a 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -33,8 +33,12 @@
#include <string.h>
#include <unistd.h>
-#ifdef __linux__
+#if defined(__linux__)
+# include <endian.h>
# include <db_185.h>
+#elif defined(__APPLE__)
+# include <libkern/OSByteOrder.h>
+# include <db.h>
#else
# include <db.h>
#endif