]> git.ipfire.org Git - thirdparty/util-linux.git/commit
BSD: Use byteswap.h and endian.h defined macos when present
authorWarner Losh <imp@FreeBSD.org>
Fri, 29 Apr 2022 21:29:44 +0000 (15:29 -0600)
committerWarner Losh <imp@FreeBSD.org>
Fri, 29 Apr 2022 21:37:52 +0000 (15:37 -0600)
commita38d1f69fee5ca7e883b09ed3668a7da3b161051
treec96f2b8e21f3dd3ac57bed8e166d48213f2a5ef9
parent104dc2e092058489a4be17d5b15902e58ca56804
BSD: Use byteswap.h and endian.h defined macos when present

Newer versions of FreeBSD will have a glibc compatible
byteswap.h. Currently, this file assumes that FreeBSD requires
bswap{16,32,64} to always be defined. This isn't the case when we're
using the byteswap.h file (which is enabled by HAVE_BYTESWAP_H
define). Assume that if byteswap.h and endian.h are present, then the
proper macros are defined.  Otherwise, assume that sys/endian.h is
present and paper over the small differences between the BSDs for this
file.

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