From 6b0f55c489ff78bd29d6d881fddf7abeabbed12f Mon Sep 17 00:00:00 2001 From: Michal Vyskocil Date: Fri, 12 Oct 2012 15:21:49 +0200 Subject: [PATCH 09/10] glibc endianness check in md5 https://bugzilla.novell.com/show_bug.cgi?id=406825 --- md5/md5.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/md5/md5.c b/md5/md5.c index 233ee2d..3ad899b 100644 --- a/md5/md5.c +++ b/md5/md5.c @@ -45,6 +45,15 @@ #include "md5.h" #include +/* endianness check using glibc endian.h */ +#include + +#if __BYTE_ORDER == __BIG_ENDIAN +# define ARCH_IS_BIG_ENDIAN 1 +#elif __BYTE_ORDER == __LITTLE_ENDIAN +# define ARCH_IS_BIG_ENDIAN 0 +#endif + #ifdef TEST /* * Compile with -DTEST to create a self-contained executable test program. -- 1.7.11.5