When a BSD sub-os header is included directly the general
OS_BSD predef is inidially defined as not-available. Which
warns as the sub-os header defines it. The fix is to unconditionally
un-def the OS_BSD predef.
fixes https://github.com/boostorg/predef/issues/111
The headers on a Boost release are only present at the root. This adds that to the include search path so that the checks can also work on that structure.
boost/predef/other/endian.h has two ways of detecting the endianess:
(1) It includes <endian.h> if BOOST_LIB_C_GNU is defined, and then
use __BYTE_ORDER to decide the endianness.
(2) Otherwise, if (1) was not possible for some reason, it uses
architecture defines to decide the endianness.
(1) works perfectly fine with glibc toolchains, because
BOOST_LIB_C_GNU is defined, but it doesn't work with musl. Due to
this, <endian.h> is not included, __BYTE_ORDER is not defined, and
method (1) does not work, causing build failures on musl toolchains
that don't have explicit handling by architecture name (method 2).
So this commit fixes RISC-V musl build by adding support for the
__riscv architecture define, to determine that the endianness is
little endian.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This reworks the order in which the compiler predefs are checked to use
the ones that provide version info. Also add the arch predefs for older
compilers that don't define the predefs with version info for arm4,
arm5, arm6, and arm7.
Continuation of #94