changeset 50448:a0e39f5bb7cd

sha1dc: Make sure SHA1DC_BIGENDIAN is set on Darwin/PowerPC __BYTE_ORDER__ is not defined on old toolchains so sha1dc gets built in little endian mode on a big endian platform, hilarity ensues. Tested on Mac OS X Tiger 10.4.
author Sevan Janiyan <venture37@geeklan.co.uk>
date Fri, 14 Apr 2023 19:59:44 +0100
parents 45c7bada5200
children 6b916efe6af6
files mercurial/thirdparty/sha1dc/lib/sha1.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/thirdparty/sha1dc/lib/sha1.c	Sat Apr 13 03:44:55 2019 +0200
+++ b/mercurial/thirdparty/sha1dc/lib/sha1.c	Fri Apr 14 19:59:44 2023 +0100
@@ -102,6 +102,10 @@
  */
 #define SHA1DC_BIGENDIAN
 
+#elif (defined(__APPLE__) && defined(__BIG_ENDIAN__) && !defined(SHA1DC_BIGENDIAN))
+/* older gcc compilers which are the default on Apple PPC do not define __BYTE_ORDER__ */
+#define SHA1DC_BIGENDIAN
+
 /* Not under GCC-alike or glibc or *BSD or newlib or <processor whitelist> or <os whitelist> */
 #elif defined(SHA1DC_ON_INTEL_LIKE_PROCESSOR)
 /*