summaryrefslogtreecommitdiff
path: root/lib/md5.c
diff options
context:
space:
mode:
authorThomas Weißschuh <thomas@t-8ch.de>2022-10-14 21:54:47 +0200
committerThomas Weißschuh <thomas@t-8ch.de>2022-10-14 22:00:48 +0200
commit83b418c19c3959b2f23bba6c7cf1316ee6e404ed (patch)
tree9e4690454ed0bc79015ca196b224fbbe819411d0 /lib/md5.c
parent4d447c11cfb45a31937d5e57862c403fc68b665a (diff)
downloadutil-linux-83b418c19c3959b2f23bba6c7cf1316ee6e404ed.tar.gz
autotools: stop using AC_C_BIGENDIAN / WORDS_BIGENDIAN
This define is specific to autotools. Not defining the macro will lead to silently miscompiled code as has happened with the meson build. Instead use macros provided by the compiler itself. It does not need any support from the buildsystem and is supported by both gcc and clang. If a compiler does not support this feature we will get a loud error instead of silent miscompilation. Furthermore it probably better supports universal binaries on macOS which compiles multiple architectures in a single build.
Diffstat (limited to 'lib/md5.c')
-rw-r--r--lib/md5.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/md5.c b/lib/md5.c
index 3765ab93e..eedc71b07 100644
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -18,7 +18,7 @@
#include "md5.h"
-#if !defined(WORDS_BIGENDIAN)
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
# define byteReverse(buf, len) /* Nothing */
#else
static void byteReverse(unsigned char *buf, unsigned longs);
@@ -38,7 +38,7 @@ static void byteReverse(unsigned char *buf, unsigned longs)
} while (--longs);
}
#endif /* !ASM_MD5 */
-#endif /* !WORDS_BIGENDIAN */
+#endif /* __ORDER_LITTLE_ENDIAN__ */
/*
* Start MD5 accumulation. Set bit count to 0 and buffer to mysterious