#1922 closed Bugs (fixed)
endian.hpp may select a wrong endian for NetBSD
Reported by: | Owned by: | John Maddock | |
---|---|---|---|
Milestone: | Boost 1.36.0 | Component: | None |
Version: | Boost 1.35.0 | Severity: | Problem |
Keywords: | Cc: |
Description
In <boost/detail/endian.hpp>:
#elif defined(_BIG_ENDIAN) # define BOOST_BIG_ENDIAN # define BOOST_BYTE_ORDER 4321 #elif defined(_LITTLE_ENDIAN) # define BOOST_LITTLE_ENDIAN # define BOOST_BYTE_ORDER 1234
But, the system header <sys/endian.h> on NetBSD always defines _LITTLE_ENDIAN, _BIG_ENDIAN and _PDP_ENDIAN. So BOOST_BIG_ENDIAN is defined on little endian platforms.
Please change it as follow:
#elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) # define BOOST_BIG_ENDIAN # define BOOST_BYTE_ORDER 4321 #elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN) # define BOOST_LITTLE_ENDIAN # define BOOST_BYTE_ORDER 1234
Change History (3)
comment:1 by , 14 years ago
Owner: | set to |
---|
follow-up: 3 comment:2 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:3 by , 14 years ago
Replying to johnmaddock:
Patch applied in revision #45608.
Thanks for the report, John.
The proper WikiFormatting for the revision's reference ID is [45608]. You accidentally created a link to a ticket with that number, one that does not exist at the time of this posting.
Note:
See TracTickets
for help on using tickets.
Patch applied in revision #45608.
Thanks for the report, John.