Skip to content
Snippets Groups Projects
Commit 4ecc9883 authored by Emmanuel Vadot's avatar Emmanuel Vadot Committed by Tom Rini
Browse files

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: default avatarEmmanuel Vadot <manu@bidouilliste.com>
parent e2351d5c
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment