Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#1922 closed Bugs (fixed)

endian.hpp may select a wrong endian for NetBSD

Reported by: Takeshi Mouri <takeshi.mouri.net@…> 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 Marshall Clow, 14 years ago

Owner: set to John Maddock

comment:2 by John Maddock, 14 years ago

Resolution: fixed
Status: newclosed

Patch applied in revision #45608.

Thanks for the report, John.

in reply to:  2 comment:3 by Daryle Walker, 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.