Skip to content

Commit 1427f34

Browse files
authored
Detect endianness at build time for common MSVC targets also (libarchive#2466)
This should now cover the most common build targets.
1 parent edcae6c commit 1427f34

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

libarchive/archive_string.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@ static int archive_string_append_unicode(struct archive_string *,
206206
#define IS_BIG_ENDIAN 0
207207
#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
208208
#define IS_BIG_ENDIAN 1
209+
#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64) || defined(_M_ARM64))
210+
#define IS_BIG_ENDIAN 0
209211
#else
210212
// Detect endianness at runtime.
211213
static int

0 commit comments

Comments
 (0)