HomeFreeBSD

byteswap.h: Add a glibc/linux compatible byteswap.h

Description

byteswap.h: Add a glibc/linux compatible byteswap.h

For endian.h to work instead of sys/endian.h, some software needs
byteswap.h available. It must define {,}byteswap_{16,32,64}.
Included sys/_endian.h to get an appropriate
byteswap16, etc
and defines the new macros in terms of them. Enhance _endian.h
to allow it to be included from here too.

Sponsored by: Netflix
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D32051

(cherry picked from commit 1761b09bf42d2842e82c1ac614c23d31c4d4c0dc)

Details

Provenance
impAuthored on Jan 20 2023, 11:33 PM
Reviewer
markj
Differential Revision
D32051: byteswap.h: Add a glibc/linux compatible byteswap.h
Parents
rG1004da283d45: linux: For better compatibility, provide compatible endian.h
Branches
Unknown
Tags
Unknown