mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
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:
@@ -226,16 +226,14 @@ typedef uint32_t sha1word;
|
||||
* careful programming can guarantee this for us.
|
||||
*/
|
||||
|
||||
#if defined(_BIG_ENDIAN)
|
||||
#if defined(_ZFS_BIG_ENDIAN)
|
||||
#define LOAD_BIG_32(addr) (*(uint32_t *)(addr))
|
||||
|
||||
#elif defined(HAVE_HTONL)
|
||||
#define LOAD_BIG_32(addr) htonl(*((uint32_t *)(addr)))
|
||||
|
||||
#else
|
||||
/* little endian -- will work on big endian, but slowly */
|
||||
#define LOAD_BIG_32(addr) \
|
||||
(((addr)[0] << 24) | ((addr)[1] << 16) | ((addr)[2] << 8) | (addr)[3])
|
||||
#define LOAD_BIG_32(addr) BE_32(*((uint32_t *)(addr)))
|
||||
#endif /* _BIG_ENDIAN */
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user