diff options
author | Thomas Weißschuh <thomas@t-8ch.de> | 2022-10-14 21:54:47 +0200 |
---|---|---|
committer | Thomas Weißschuh <thomas@t-8ch.de> | 2022-10-14 22:00:48 +0200 |
commit | 83b418c19c3959b2f23bba6c7cf1316ee6e404ed (patch) | |
tree | 9e4690454ed0bc79015ca196b224fbbe819411d0 /lib/md5.c | |
parent | 4d447c11cfb45a31937d5e57862c403fc68b665a (diff) | |
download | util-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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 |