diff options
author | 默默 <wangqiang1588@sina.com> | 2019-03-31 16:07:03 +0800 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-04-03 10:26:46 -0400 |
commit | ab8fc413028b4fd22492a93ef31223d606cac5a6 (patch) | |
tree | 6d7126e5cbb95858e7cd5e3238ec1bf75d21f97c /lib/bch.c | |
parent | 2118a272e3c2ae9e677ab0527939a979dc1a0f60 (diff) | |
download | u-boot-ab8fc413028b4fd22492a93ef31223d606cac5a6.zip u-boot-ab8fc413028b4fd22492a93ef31223d606cac5a6.tar.gz u-boot-ab8fc413028b4fd22492a93ef31223d606cac5a6.tar.bz2 |
fix compile error on macOS Mojave
Diffstat (limited to 'lib/bch.c')
-rw-r--r-- | lib/bch.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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; |