bch: don't use __BSD_VISIBLE to test for fls
PATCH 1/1 bch: don't use __BSD_VISIBLE to test for fls
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.
--- lib/bch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bch.c +1 -1
@@ -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;
Signature · 1 line
2.14.1
Quoted 9 lines · Jonathan Gray
Commit
4ecc988301bc8e981e6d7538c57cdb3aa82f7c1dassumes fls is in libc if__BSD_VISIBLEis defined. This appears to only be true on FreeBSD and DragonFlyBSD. OpenBSD defines__BSD_VISIBLEand does not have fls in strings.h/libc.Switch the test for
__BSD_VISIBLEto one for__DragonFly__and__FreeBSD__to unbreak the build on OpenBSD.Signed-off-by Jonathan Gray <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170903/352afea6/attachment.sig>