]> git.ipfire.org Git - thirdparty/git.git/commit
compat/bswap.h: don't assume MSVC is little-endian
authorDaniel Gurney <dgurney99@gmail.com>
Wed, 11 Nov 2020 08:32:27 +0000 (10:32 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 11 Nov 2020 19:24:47 +0000 (11:24 -0800)
commit0c038fc65a2c2792de3fbe71f85ace4c0292d71c
tree930c389927d23c830fd15542c147a9b290d85a06
parent1af265f0a01bba0daac8865ad38075f0cb124743
compat/bswap.h: don't assume MSVC is little-endian

In 1af265f0 (compat/bswap.h: simplify MSVC endianness
detection, 2020-11-08) we attempted to simplify code by assuming MSVC
builds will be for little-endian machines, since only unusably old
versions of MSVC supported big-endian MIPS and m68k architectures.

However, it's possible that MSVC could be ported to build for a
big-endian architecture again, so the simplification wasn't as
future-proof as hoped.

So let's go back to the old way of detecting MSVC, and then checking
architecture from a list of little-endian architecture macros.

Note that MSVC does not treat ARM64 as bi-endian, so we can safely treat
it as little-endian.

Helped-by: brian m. carlson <sandals@crustytoothpaste.net>
Helped-by: Jeff King <peff@peff.net>
Helped-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Daniel Gurney <dgurney99@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/bswap.h