2
0
mirror of https://github.com/boostorg/predef.git synced 2026-01-19 04:22:14 +00:00
Thomas Petazzoni 4bc7cc02ed Add RISC-V endian detection (#100)
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>
2019-08-03 10:25:06 -05:00
2014-08-18 15:09:00 +01:00
2019-04-21 22:15:17 -05:00
2014-01-02 21:18:34 -06:00
2019-04-21 22:15:17 -05:00
2019-04-21 22:15:17 -05:00
Description
Mirrored via gitea-mirror
1.5 MiB
Languages
C 87.2%
C++ 10.5%
CMake 0.9%
Shell 0.8%
Objective-C++ 0.2%
Other 0.4%