summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2019-04-03 10:26:57 -0400
committerTom Rini <[email protected]>2019-04-03 10:26:57 -0400
commit05fa129a40e33adf8f6e681326d4d50c1462d163 (patch)
treedef7b49210e59859d2b8e53d086df287aa9a9f07 /lib
parent7252274978dc860ad5f89cbe3b8d99cf793107ce (diff)
parentd7edeba79b2776a2097adf952b3b392c2dfb036b (diff)
Merge branch '2019-04-03-master-imports'
- Important Khadas VIM2 fix - Build fix for macOS Mojave - Build fix for gcc-4.7 for host tools.
Diffstat (limited to 'lib')
-rw-r--r--lib/bch.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/bch.c b/lib/bch.c
index 20079eb9ebd..c4fac77d611 100644
--- a/lib/bch.c
+++ b/lib/bch.c
@@ -62,6 +62,9 @@
#include <errno.h>
#if defined(__FreeBSD__)
#include <sys/endian.h>
+#elif defined(__APPLE__)
+#include <machine/endian.h>
+#include <libkern/OSByteOrder.h>
#else
#include <endian.h>
#endif
@@ -70,7 +73,11 @@
#include <string.h>
#undef cpu_to_be32
+#if defined(__APPLE__)
+#define cpu_to_be32 OSSwapHostToBigInt32
+#else
#define cpu_to_be32 htobe32
+#endif
#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
#define kmalloc(size, flags) malloc(size)
#define kzalloc(size, flags) calloc(1, size)
@@ -116,7 +123,7 @@ struct gf_poly_deg1 {
};
#ifdef USE_HOSTCC
-#if !defined(__DragonFly__) && !defined(__FreeBSD__)
+#if !defined(__DragonFly__) && !defined(__FreeBSD__) && !defined(__APPLE__)
static int fls(int x)
{
int r = 32;