From: Sage Weil Date: Thu, 8 Oct 2009 21:21:08 +0000 (-0700) Subject: byteorder: properly detect endianness X-Git-Tag: v0.17~106 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a33441c4b274d840432ba553db463cbee1f1a480;p=ceph.git byteorder: properly detect endianness --- diff --git a/src/include/byteorder.h b/src/include/byteorder.h index cdd003781dd..d65493244ae 100644 --- a/src/include/byteorder.h +++ b/src/include/byteorder.h @@ -31,11 +31,14 @@ static __inline__ __u64 swab64(__u64 val) } // mswab == maybe swab (if not LE) -#if __BYTEORDER == __BIG_ENDIAN +#if defined(__BIG_ENDIAN__) || defined(__BIG_ENDIAN) # define mswab64(a) swab64(a) # define mswab32(a) swab32(a) # define mswab16(a) swab16(a) #else +# if !defined(__LITTLE_ENDIAN__) && !defined(__LITTLE_ENDIAN) +# warning unknown endianness, assuming little +# endif # define mswab64(a) (a) # define mswab32(a) (a) # define mswab16(a) (a)