Mercurial > HandyFTP
changeset 149:9273246a409a
Change _BIG_ENDIAN test to use _BYTE_ORDER if available.
This fixes Andrdoid not using the correct endianess.
Hopefully this doesn't break actual Big Endian platforms like PPC.
author | Brian Smith <brian@dbsoft.org> |
---|---|
date | Mon, 01 Nov 2021 09:27:24 -0500 |
parents | ecbc8a7a8664 |
children | 9d04bebd8e06 |
files | src/handyftp.c |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/handyftp.c Mon Oct 25 00:16:17 2021 -0600 +++ b/src/handyftp.c Mon Nov 01 09:27:24 2021 -0500 @@ -3157,7 +3157,8 @@ } typedef struct _ip { -#ifdef _BIG_ENDIAN + /* Can't just check for _BIG_ENDIAN, Android has it defined but _BYTE_ORDER = _LITTLE_ENDIAN */ +#if defined(_BIG_ENDIAN) && (!defined(_BYTE_ORDER) || (defined(_BYTE_ORDER) && _BYTE_ORDER == _BIG_ENDIAN)) unsigned char ip4, ip3, ip2, ip1; #else unsigned char ip1, ip2, ip3, ip4;