]> err.no Git - util-linux/commitdiff
lib: add __BYTE_ORDER to md5.c
authorKarel Zak <kzak@redhat.com>
Mon, 8 Dec 2008 10:12:30 +0000 (11:12 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 8 Dec 2008 10:12:30 +0000 (11:12 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/md5.c

index a78eec4671bad67536f5ff4356710430b50fc5d5..306984517bc8e962a6893b738ba7a058b3408e3e 100644 (file)
--- a/lib/md5.c
+++ b/lib/md5.c
  * needed on buffers full of bytes, and then call MD5Final, which
  * will fill a supplied 16-byte array with the digest.
  */
+#include <endian.h>
 #include <string.h>            /* for memcpy() */
 
 #include "md5.h"
 
-#ifndef HIGHFIRST
+#if !defined __BYTE_ORDER || !(__BYTE_ORDER == __LITTLE_ENDIAN) && !(__BYTE_ORDER == __BIG_ENDIAN)
+#error missing __BYTE_ORDER
+#endif
+
+#if (__BYTE_ORDER == __LITTLE_ENDIAN)
 #define byteReverse(buf, len)  /* Nothing */
 #else
 void byteReverse(unsigned char *buf, unsigned longs);