Prefix zfs internal endian checks with _ZFS

FreeBSD defines _BIG_ENDIAN BIG_ENDIAN _LITTLE_ENDIAN
LITTLE_ENDIAN on every architecture. Trying to do
cross builds whilst hiding this from ZFS has proven
extremely cumbersome.

Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
Closes #10621
This commit is contained in:
Matthew Macy
2020-07-28 13:02:49 -07:00
committed by GitHub
parent 3eabed74c0
commit 5678d3f593
23 changed files with 99 additions and 240 deletions
+2 -2
View File
@@ -43,7 +43,7 @@
#define _RESTRICT_KYWD
#ifdef _LITTLE_ENDIAN
#ifdef _ZFS_LITTLE_ENDIAN
#include <sys/byteorder.h>
#define HAVE_HTONL
#endif
@@ -123,7 +123,7 @@ static uint8_t PADDING[128] = { 0x80, /* all zeros */ };
* careful programming can guarantee this for us.
*/
#if defined(_BIG_ENDIAN)
#if defined(_ZFS_BIG_ENDIAN)
#define LOAD_BIG_32(addr) (*(uint32_t *)(addr))
#define LOAD_BIG_64(addr) (*(uint64_t *)(addr))