[PATCH] byteorder: do not assume PowerPC is big-endian

David Disseldorp ddiss at suse.de
Mon May 5 11:01:18 MDT 2014


Hi Christof,

On Mon, 5 May 2014 09:17:12 -0700, Christof Schmitt wrote:

> i saw the bugzilla review request. Without having access to a power
> system, i can only review the code. It looks correct, but i saw that
> there is already a endianess check in buildtools/wafsamba/wscript:
> 
>     conf.CHECK_CODE('long one = 1; return ((char *)(&one))[0]',
>                     execute=True,
>                     define='WORDS_BIGENDIAN')
> 
> You could use the WORDS_BIGENDIAN define instead of importing ccan. Of
> course, it the longterm it would be good to only have one endianess
> check, maybe the ccan one.

Thanks for the pointer, I hadn't come across that check.
My preference would still be to continue to use the lib/ccan/wscript
endianness checks, as they first use the __BYTE_ORDER, __BIG_ENDIAN and
__LITTLE_ENDIAN definitions before doing the runtime test. They also
fail if endianness can't be determined.

Cheers, David


More information about the samba-technical mailing list