Re: [Pmk-users] Detecting endian ness issues
Brought to you by:
coudercd
|
From: Damien C. <mip...@us...> - 2005-01-26 10:56:55
|
Erik de Castro Lopo wrote: > I think you missed the point. The above is a valid test for endian ness, > but I'm more interested in knowing how the detected endinaness is > represented in the resulting config.h file. > > If it is represented as the presense or absense of a #define then it is > wrong. > > It must represented like this for big endian: > > #define WORDS_BIGENDIAN 1 > #define WORDS_LITTLEENDIAN 0 > > and this for little endian: > > #define WORDS_BIGENDIAN 0 > #define WORDS_LITTLEENDIAN 1 The result is that the HW_BYTEORDER tag is set to one of the three following values: LITTLE_ENDIAN BIG_ENDIAN UNKNOWN_ENDIAN Then everybody is able to transform this information in respect to their need. Damien |