Skip to content

AMQP-CPP overwrites reserved preprocessor definitions: __BYTE_ORDER, __BIG_ENDIAN, __LITTLE_ENDIAN #546

@darop86

Description

@darop86

Describe the bug
In the header file endian.h (line 104ff) AMQP-CPP sets the reserved processor definitions __BYTE_ORDER, __BIG_ENDIAN, __LITTLE_ENDIAN to custom values.
This causes (for example) a compiler error when using boost::math because boost uses the values of those identifiers to detect the current system's endianness (in <boost/predef/other/endian.h>).
This results in a compiler error during boost's endianness detection when including AMQP-CPP BEFORE including boost.

Furthermore I think that modifying these macros is illegal (or at least undefined behavior) according to the standard:
https://en.cppreference.com/w/c/language/identifier.html (identifiers starting with an underscore followed by a capital letter or another underscore are reserved for the compiler/standard library/OS vendors).

Expected behavior and actual behavior
Do not modify system defined preprocessor definitions.

Sample code
n\a

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions