diff options
author | Matthew Macy <[email protected]> | 2020-07-28 13:02:49 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2020-07-28 13:02:49 -0700 |
commit | 5678d3f59389a241c8d9c032513c38209bb53e70 (patch) | |
tree | b25aa376cb42cc0bb173ab1250e27dccc98b4de7 /module/nvpair/nvpair.c | |
parent | 3eabed74c0fca5dd9f96d2cca13c4a1a16d5c094 (diff) |
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 <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Matt Macy <[email protected]>
Closes #10621
Diffstat (limited to 'module/nvpair/nvpair.c')
-rw-r--r-- | module/nvpair/nvpair.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/module/nvpair/nvpair.c b/module/nvpair/nvpair.c index 6c0261f08..20a58802f 100644 --- a/module/nvpair/nvpair.c +++ b/module/nvpair/nvpair.c @@ -2555,11 +2555,13 @@ nvlist_common(nvlist_t *nvl, char *buf, size_t *buflen, int encoding, int err = 0; nvstream_t nvs; int nvl_endian; -#ifdef _LITTLE_ENDIAN +#if defined(_ZFS_LITTLE_ENDIAN) int host_endian = 1; -#else +#elif defined(_ZFS_BIG_ENDIAN) int host_endian = 0; -#endif /* _LITTLE_ENDIAN */ +#else +#error "No endian defined!" +#endif /* _ZFS_LITTLE_ENDIAN */ nvs_header_t *nvh; if (buflen == NULL || nvl == NULL || |