Boost logo

Boost :

Subject: Re: [boost] Official boost macro to determine endianess?
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2017-04-05 09:25:13


On 04/05/17 12:00, Frédéric Bron via Boost wrote:
> What is the official boost macro to determine endianess?
> And what is the header to include to get it?
>
> I cannot find any help in the documentation of boost.endian but I can
> find those macros by grepping in boost:
>
> BOOST_LITTLE_ENDIAN, BOOST_BIG_ENDIAN, BOOST_ENDIAN_BIG_BYTE,
> BOOST_ENDIAN_BIG_WORD, BOOST_ENDIAN_LITTLE_BYTE,
> BOOST_ENDIAN_LITTLE_WORD, BOOST_PDP_ENDIAN

I think the modern way to do this is to use Boost.Predef[1].

BOOST_LITTLE_ENDIAN, BOOST_BIG_ENDIAN and BOOST_PDP_ENDIAN predate
Boost.Predef and are deprecated.

[1]:
http://www.boost.org/doc/libs/1_63_0/doc/html/predef/reference.html#predef.reference.other_macros.boost_endian


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk