mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 19:57:43 +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:
@@ -26,6 +26,15 @@
|
||||
#define _SPL_BYTEORDER_H
|
||||
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
#if defined(__BIG_ENDIAN) && !defined(_ZFS_BIG_ENDIAN)
|
||||
#define _ZFS_BIG_ENDIAN
|
||||
#endif
|
||||
|
||||
#if defined(__LITTLE_ENDIAN) && !defined(_ZFS_LITTLE_ENDIAN)
|
||||
#define _ZFS_LITTLE_ENDIAN
|
||||
#endif
|
||||
|
||||
#include <sys/isa_defs.h>
|
||||
|
||||
#define BSWAP_8(x) ((x) & 0xff)
|
||||
@@ -49,7 +58,7 @@
|
||||
#define BE_IN32(xa) \
|
||||
(((uint32_t)BE_IN16(xa) << 16) | BE_IN16((uint8_t *)(xa)+2))
|
||||
|
||||
#ifdef _BIG_ENDIAN
|
||||
#ifdef _ZFS_BIG_ENDIAN
|
||||
static __inline__ uint64_t
|
||||
htonll(uint64_t n)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user