[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: calling all ports: what is your endianness?



On Mon, Jan 21, 2002 at 07:32:39PM -0500, Daniel Burrows wrote:
> > I just uploaded new Boost (www.boost.org) C++ libraries to sid, and
> > discovered that they have this buried inside the headers:
> > 
> > 
> > #if defined(__sparc) || defined(__sparc__) || defined(__powerpc__) || defined(__ppc__) || defined(__hppa) || defined(_MIPSEB)
> > #define BOOST_BIG_ENDIAN
> > #elif defined(__i386__)
> > #define BOOST_LITTLE_ENDIAN
> > #else
> > #error The file boost/detail/limits.hpp needs to be set up for your CPU type.
> > #endif
> > 
> > 
> > This has already tripped up the alpha autobuilder.  
> > 
> > If your favourite architecture is NOT listed in the above, could you
> > please send me:
> > 
> >   1. a preprocessor symbol to test for, and
> >   2. the correct endianness.
> 
>   Shouldn't this be a configure test?  I'd imagine that just stuffing
> several bytes into an array and then testing the result as a word would
> be sufficient.

AC_C_BIGENDIAN sets WORDS_BIGENDIAN.  Things like that should never be
hardcoded.

-- 
Glenn Maynard



Reply to: