[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:22:48PM -0500, "Steve M. Robbins" <steven.robbins@videotron.ca> was heard to say:
> 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.

  Am I being naive?

  Daniel

-- 
/----------------- Daniel Burrows <Daniel_Burrows@brown.edu> -----------------\
|                "Don't underestimate the power of the force."                |
|                  -- D. Vader                                                |
\------------- Got APT? -- Debian GNU/Linux http://www.debian.org ------------/



Reply to: