]> www.infradead.org Git - users/sagi/libnvme.git/commit
ccan/endian.h: Only define __{BIG,LITTLE}_ENDIAN if undefined.
authorWarner Losh <imp@bsdimp.com>
Fri, 3 May 2024 17:39:42 +0000 (11:39 -0600)
committerDaniel Wagner <wagi@monom.org>
Mon, 6 May 2024 17:22:35 +0000 (19:22 +0200)
commit26b0eaf36828082e8d895138cd0e106e5be32cf4
treecdd70b438c0500dc527ae96ee7c8d236c4437d82
parenteb99b0c365138c9d87d68167b94546ea9d373939
ccan/endian.h: Only define __{BIG,LITTLE}_ENDIAN if undefined.

When both endian.h and ccan/endian/endian.h are included, we can have
__{BIG,LITTLE}_ENDIAN redefined when compiling with clang on FreeBSD.
Clang and gcc have moved to a predefine for endian orders. glibc defines
these the same as they are defied here, but that's an unsafe assumption
to make. Instead, only define them when __LITTLE_ENDIAN not defined as a
fallback to when the host does not define them in the standard system
headers.

Signed-off-by: Warner Losh <imp@bsdimp.com>
ccan/ccan/endian/endian.h