]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
bch: don't use __BSD_VISIBLE to test for fls
authorJonathan Gray <jsg@jsg.id.au>
Sun, 27 Aug 2017 10:45:14 +0000 (20:45 +1000)
committerTom Rini <trini@konsulko.com>
Sun, 3 Sep 2017 19:30:31 +0000 (15:30 -0400)
Commit 4ecc988301bc8e981e6d7538c57cdb3aa82f7c1d assumes fls is in libc
if __BSD_VISIBLE is defined.  This appears to only be true on FreeBSD
and DragonFlyBSD.  OpenBSD defines __BSD_VISIBLE and does not have fls
in strings.h/libc.

Switch the test for __BSD_VISIBLE to one for __DragonFly__ and
__FreeBSD__ to unbreak the build on OpenBSD.

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
lib/bch.c

index 7a2d9d3b86b7a69b213662f4dd1e6be836aa21f2..d0d7e25c4ee36f9a3e9f3665023a1b71a4c073c4 100644 (file)
--- a/lib/bch.c
+++ b/lib/bch.c
@@ -117,7 +117,7 @@ struct gf_poly_deg1 {
 };
 
 #ifdef USE_HOSTCC
-#ifndef __BSD_VISIBLE
+#if !defined(__DragonFly__) && !defined(__FreeBSD__)
 static int fls(int x)
 {
        int r = 32;