* Giovanni Mascellani <[email protected]> [2020-12-30 21:22]:

Il 29/12/20 10:00, Rafael Laboissière ha scritto:

The s390x architecture is big-endian. However the following program test.c:

    ///////// test.c ////////////////////////////////////////
    #include <boost/predef/other/endian.h>
    #if defined(BOOST_ENDIAN_LITTLE_BYTE)
    According to Boost, this system is little-endian.
    #elif defined(BOOST_ENDIAN_BIG_BYTE)
    According to Boost, this system is big-endian.
    #else
    Boost cannot determine the endianness of this system.
    #endif
    ////////////////////////////////////////////////////////

The macro are always defined, you should test their value, not their existence. Basically, you need to use

   #if BOOST_ENDIAN_LITTLE_BYTE

instead of

   #if defined(BOOST_ENDIAN_LITTLE_BYTE)

With this change, your program correctly says that s390x is big-endian.

Thank you for this suggestion.  I updated the libgdf package accordingly.

Best,

Rafael Laboissière

Reply via email to