From: Emmanuel Vadot Date: Tue, 20 Jun 2017 07:02:29 +0000 (+0200) Subject: bch: Fix build on FreeBSD host X-Git-Tag: v2017.07-rc3~59 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=4ecc988301bc8e981e6d7538c57cdb3aa82f7c1d;p=oweals%2Fu-boot.git bch: Fix build on FreeBSD host endian.h on FreeBSD system exist in sys/ subdirectory. FreeBSD already have a fls function defined in strings.h which is included in string.h if __BSD_VISIBLE is defined, as a check for this. Signed-off-by: Emmanuel Vadot --- diff --git a/lib/bch.c b/lib/bch.c index ec53483774..7a2d9d3b86 100644 --- a/lib/bch.c +++ b/lib/bch.c @@ -61,7 +61,11 @@ #include #else #include +#if defined(__FreeBSD__) +#include +#else #include +#endif #include #include #include @@ -113,6 +117,7 @@ struct gf_poly_deg1 { }; #ifdef USE_HOSTCC +#ifndef __BSD_VISIBLE static int fls(int x) { int r = 32; @@ -142,6 +147,7 @@ static int fls(int x) return r; } #endif +#endif /* * same as encode_bch(), but process input data one byte at a time