Re: git: ed52baf51bd1 - main - _endian.h: Include sys/ctypes.h for visibility macros

From: Colin Percival <cperciva_at_tarsnap.com>
Date: Thu, 23 Mar 2023 07:53:27 UTC

On 3/21/23 19:26, Warner Losh wrote:
>      [...]
>      This had the side effect of sometimes (in the traditional BSD
>      compliation environment)
>       #if BYTE_ORDER == LITTLE_ENDIAN
>      and
>       #if BYTE_ORDER == BIG_ENDIAN
>      both being true because none of these were defined. This fixes
>      that. It also fixes including it after <stdio.h> but not before.

Would it be worth adding

#if LITTLE_ENDIAN == BIG_ENDIAN
#error Endian defines are broken!
#endif

just to ensure that any future issues show up quickly?

-- 
Colin Percival
FreeBSD Deputy Release Engineer & EC2 platform maintainer
Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid