]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfsprogs: fix crc32 build on big endian
authorEric Sandeen <sandeen@redhat.com>
Sat, 5 Oct 2013 02:20:03 +0000 (02:20 +0000)
committerRich Johnston <rjohnston@sgi.com>
Thu, 17 Oct 2013 19:50:56 +0000 (14:50 -0500)
commitb2dbd6a9a2df5099882bdfc068caa76cf334c99a
tree3127d154dd924966465214589bb09101a05e5eaf
parent050a7f1f79314470c18e9d11c28daf75dd959830
xfsprogs: fix crc32 build on big endian

While kernelspace can test #ifdef __LITTLE_ENDIAN, this
doesn't work in userspace.  __LITTLE_ENDIAN is defined -
as is __BIG_ENDIAN.

So we build on all boxes as __LITTLE_ENDIAN, and the
self-test (thankfully!) fails on big endian boxes.

Fix this by testing __BYTE_ORDER values.

And add an else which should never be hit, but just in case...

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
libxfs/crc32.c