aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPiotr Stefaniak <pstef@freebsd.org>2020-08-07 18:28:41 +0200
committerPaul Spooren <mail@aparcar.org>2020-11-27 18:01:22 -1000
commit1db9b5b6d65052eea7819cf0aee5163846a36bed (patch)
tree25d3a668b37c7375837a7a0007a67521747254c8
parent485ce5bbe5cc33526e56817694a79a7d94160e01 (diff)
downloadupstream-1db9b5b6d65052eea7819cf0aee5163846a36bed.tar.gz
upstream-1db9b5b6d65052eea7819cf0aee5163846a36bed.tar.bz2
upstream-1db9b5b6d65052eea7819cf0aee5163846a36bed.zip
build: mkhash on FreeBSD
Apply patch from https://bugs.openwrt.org/index.php?do=details&task_id=971 in order to make it easier to build OpenWRT on FreeBSD. Signed-off-by: Piotr Stefaniak <pstef@freebsd.org>
-rw-r--r--scripts/mkhash.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/mkhash.c b/scripts/mkhash.c
index ced4f3c34a..3292433213 100644
--- a/scripts/mkhash.c
+++ b/scripts/mkhash.c
@@ -79,7 +79,12 @@
+#ifndef __FreeBSD__
#include <endian.h>
+#else
+#include <sys/endian.h>
+#endif
+
#include <stdio.h>
#include <string.h>
#include <stdint.h>
@@ -89,6 +94,7 @@
#define ARRAY_SIZE(_n) (sizeof(_n) / sizeof((_n)[0]))
+#ifndef __FreeBSD__
static void
be32enc(void *buf, uint32_t u)
{
@@ -99,6 +105,7 @@ be32enc(void *buf, uint32_t u)
p[2] = ((uint8_t) ((u >> 8) & 0xff));
p[3] = ((uint8_t) (u & 0xff));
}
+#endif
static void
be64enc(void *buf, uint64_t u)