aboutsummaryrefslogtreecommitdiffstats
path: root/tools/include
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-03-07 17:32:29 +0000
committerFelix Fietkau <nbd@openwrt.org>2013-03-07 17:32:29 +0000
commitcf3d83fe4a758c9fc0dc2e575b90c77f4fe18df8 (patch)
treee8523fabf4000faec51681f5e2c90940f9382291 /tools/include
parentd32fdeb4c0dc838022fc38b50191d482f2cca20c (diff)
downloadmaster-187ad058-cf3d83fe4a758c9fc0dc2e575b90c77f4fe18df8.tar.gz
master-187ad058-cf3d83fe4a758c9fc0dc2e575b90c77f4fe18df8.tar.bz2
master-187ad058-cf3d83fe4a758c9fc0dc2e575b90c77f4fe18df8.zip
build: BSD compile fixes
following patch allows to build images for Qemu ARM on OpenBSD 5.2 amd64 and FreeBSD 9.1 amd64. Mostly small pieces of code changes to get things right on the specific platform. Updated the README to describe better, which tools on the host are required. Added some kind of prepare scripts to install needed tools on BSD via packages. Signed-off-by: Waldemar Brodkorb <mail@waldemar-brodkorb.de> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35900 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'tools/include')
-rw-r--r--tools/include/endian.h5
-rw-r--r--tools/include/getline.h2
2 files changed, 6 insertions, 1 deletions
diff --git a/tools/include/endian.h b/tools/include/endian.h
index 0f17b41da7..bba70abd83 100644
--- a/tools/include/endian.h
+++ b/tools/include/endian.h
@@ -15,6 +15,11 @@
#define bswap_16(x) bswap16(x)
#define bswap_32(x) bswap32(x)
#define bswap_64(x) bswap64(x)
+#elif defined(__OpenBSD__)
+#include <sys/types.h>
+#define bswap_16(x) __swap16(x)
+#define bswap_32(x) __swap32(x)
+#define bswap_64(x) __swap64(x)
#else
#include <machine/endian.h>
#define bswap_16(x) swap16(x)
diff --git a/tools/include/getline.h b/tools/include/getline.h
index 02df6c2f79..3ac21715b8 100644
--- a/tools/include/getline.h
+++ b/tools/include/getline.h
@@ -32,7 +32,7 @@
#include <stdlib.h>
#include <string.h>
-#if !defined(__linux__) && !(defined(__APPLE__) && __DARWIN_C_LEVEL >= 200809L)
+#if !defined(__linux__) && !defined(__OpenBSD__) && !(defined(__APPLE__) && __DARWIN_C_LEVEL >= 200809L)
/*
* Emulate glibc getline() via BSD fgetln().
* Note that outsize is not changed unless memory is allocated.