]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Detect endianness at build time for common MSVC targets also (#2466)
authorMostyn Bramley-Moore <mostyn@antipode.se>
Mon, 30 Dec 2024 16:31:14 +0000 (17:31 +0100)
committerGitHub <noreply@github.com>
Mon, 30 Dec 2024 16:31:14 +0000 (08:31 -0800)
This should now cover the most common build targets.

libarchive/archive_string.c

index ef0bb7c88c0f03867161daa39dd8bcc9611a7ff5..8ab3b994b4bb2febaa793a217bf9f2b81ec3c6a8 100644 (file)
@@ -206,6 +206,8 @@ static int archive_string_append_unicode(struct archive_string *,
   #define IS_BIG_ENDIAN 0
 #elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
   #define IS_BIG_ENDIAN 1
+#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64) || defined(_M_ARM64))
+  #define IS_BIG_ENDIAN 0
 #else
 // Detect endianness at runtime.
 static int