bch: Fix build on FreeBSD host
PATCH 1/1 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.
--- lib/bch.c | 6 ++++++ 1 file changed, 6 insertions(+)
lib/bch.c +6 -0
@@ -61,7 +61,11 @@#include <linux/bitops.h> #else #include <errno.h> +#if defined(__FreeBSD__) +#include <sys/endian.h> +#else #include <endian.h> +#endif #include <stdint.h> #include <stdlib.h> #include <string.h>
@@ -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
Signature · 1 line
2.13.1
PATCH 1/1 bch: Fix build on FreeBSD host
Quoted 3 lines · Emmanuel Vadot
endian.hon FreeBSD system exist in sys/ subdirectory.
FreeBSD already have a fls function defined instrings.hwhich is included instring.hif__BSD_VISIBLEis defined, as a check for this.
This broke the build of u-boot on OpenBSD where there is no fls in strings.h.
Quoted 45 lines
Signed-off-by Emmanuel Vadot <[email protected]>--- lib/bch.c | 6 ++++++ 1 file changed, 6 insertions(+)lib/bch.c +6
-0@@ -61,7 +61,11 @@#include <linux/bitops.h> #else #include <errno.h> +#if defined(__FreeBSD__) +#include <sys/endian.h> +#else #include <endian.h> +#endif #include <stdint.h> #include <stdlib.h> #include <string.h> @@ -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 Signature · 6 lines
2.13.1 _______________________________________________ U-Boot mailing list U-Boot at lists.denx.de https://lists.denx.de/listinfo/u-boot
PATCH 1/1 bch: Fix build on FreeBSD host
Quoted 7 lines · On Wed, 19 Jul 2017 16:26:13 +1000 Jonathan Gray <[email protected]> wrote:
Quoted 3 lines · Emmanuel Vadot
endian.hon FreeBSD system exist in sys/ subdirectory.
FreeBSD already have a fls function defined instrings.hwhich is included instring.hif__BSD_VISIBLEis defined, as a check for this.This broke the build of u-boot on OpenBSD where there is no fls in
strings.h.
Ok, I'll come up with a more specific patch for FreeBSD. Does OpenBSD have endian.h under sys/ too ?
Quoted 45 lines
Quoted 45 lines
Signed-off-by Emmanuel Vadot <[email protected]>--- lib/bch.c | 6 ++++++ 1 file changed, 6 insertions(+)lib/bch.c +6
-0@@ -61,7 +61,11 @@#include <linux/bitops.h> #else #include <errno.h> +#if defined(__FreeBSD__) +#include <sys/endian.h> +#else #include <endian.h> +#endif #include <stdint.h> #include <stdlib.h> #include <string.h> @@ -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 Signature · 6 lines
2.13.1 _______________________________________________ U-Boot mailing list U-Boot at lists.denx.de https://lists.denx.de/listinfo/u-boot
Signature · 1 line
Emmanuel Vadot <[email protected]> <[email protected]>
PATCH 1/1 bch: Fix build on FreeBSD host
Quoted 11 lines
Date: Wed, 19 Jul 2017 09:56:20 +0200
From: Emmanuel Vadot <[email protected]>Quoted 5 lines · On Wed, 19 Jul 2017 16:26:13 +1000 Jonathan Gray <[email protected]> wrote:
Quoted 3 lines · Emmanuel Vadot
endian.hon FreeBSD system exist in sys/ subdirectory.
FreeBSD already have a fls function defined instrings.hwhich is included instring.hif__BSD_VISIBLEis defined, as a check for this.
Quoted 5 lines
Quoted 2 lines
This broke the build of u-boot on OpenBSD where there is no fls in
strings.h.Ok, I'll come up with a more specific patch for FreeBSD. Does OpenBSD have
endian.hunder sys/ too ?
We have both <endian.h> and <sys/endian.h>, the former being a symlink to the latter.
Quoted 54 lines
Quoted 44 lines
Quoted 44 lines
Signed-off-by Emmanuel Vadot <[email protected]>--- lib/bch.c | 6 ++++++ 1 file changed, 6 insertions(+)lib/bch.c +6
-0@@ -61,7 +61,11 @@#include <linux/bitops.h> #else #include <errno.h> +#if defined(__FreeBSD__) +#include <sys/endian.h> +#else #include <endian.h> +#endif #include <stdint.h> #include <stdlib.h> #include <string.h> @@ -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 Signature · 6 lines
2.13.1 _______________________________________________ U-Boot mailing list U-Boot at lists.denx.de https://lists.denx.de/listinfo/u-bootSignature · 5 lines
Emmanuel Vadot <[email protected]> <[email protected]> _______________________________________________ U-Boot mailing list U-Boot at lists.denx.de https://lists.denx.de/listinfo/u-boot