build: mkhash on FreeBSD
[openwrt/openwrt.git] / scripts / mkhash.c
index ced4f3c34a8c3bf70f384c211eb6cc058140ccf3..32924332134515cba51f9208dc3e350c34cb885b 100644 (file)
 
 
 
+#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)