+// SPDX-License-Identifier: GPL-2.0
/*
* Generic binary BCH encoding/decoding library
*
- * SPDX-License-Identifier: GPL-2.0
- *
* Copyright © 2011 Parrot S.A.
*
* Author: Ivan Djelic <ivan.djelic@parrot.com>
#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>
};
#ifdef USE_HOSTCC
+#if !defined(__DragonFly__) && !defined(__FreeBSD__)
static int fls(int x)
{
int r = 32;
return r;
}
#endif
+#endif
/*
* same as encode_bch(), but process input data one byte at a time