Avoid depending on the <sys/endian.h> header for le*enc and be*enc.
authormarcel <marcel@FreeBSD.org>
Mon, 26 Sep 2016 01:06:32 +0000 (01:06 +0000)
committermarcel <marcel@FreeBSD.org>
Mon, 26 Sep 2016 01:06:32 +0000 (01:06 +0000)
commit741bf1228e837b7eb7ffbfe84f3c9544c0246ffe
tree3e22e3896d5e35e8c098e9e8ad11ea1460ff9073
parent0d01313de9d27475c2dc5bc68352d9dfb2c54b52
Avoid depending on the <sys/endian.h> header for le*enc and be*enc.
Not only is the header unportable, the encoding/decoding functions
are as well.  Instead, duplicate the handful of small inlines we
need into a private header called endian.h.

Aside: an alternative approach is to move the encoding/decoding
functions to a separate system header.  While the header is still
nonportable, such an approach would make it possible to re-use the
definitions by playing games with include paths. This may be the
preferred approach if more (build) utilities need this.  This
change does not preclude that.  In fact, it makes it easier.
12 files changed:
usr.bin/mkimg/apm.c
usr.bin/mkimg/bsd.c
usr.bin/mkimg/ebr.c
usr.bin/mkimg/endian.h [new file with mode: 0644]
usr.bin/mkimg/gpt.c
usr.bin/mkimg/mbr.c
usr.bin/mkimg/pc98.c
usr.bin/mkimg/qcow.c
usr.bin/mkimg/raw.c
usr.bin/mkimg/vhd.c
usr.bin/mkimg/vmdk.c
usr.bin/mkimg/vtoc8.c