Add endian.h. This includes sys/endian.h and then adds extra defines
that glibc defines with double underscores for our
_{BIG,BYTE,LITTLE,PDP}_ENDIAN macros. We also define __FLOAT_WORD_ORDER
to be the same as _BYTE_ENDIAN since FreeBSD doesn't currently
define this.
This gives us good compatibility with Linux.
There are some minor differences:
o The extra glibc macros are not defined. These are all
controlled with either __ at the start, or only defined
when glibc is being built.
o glibc only defines [bl]e*toh and hto[bl]e*() in permissive
environments. FreeBSD always defines them (changing this
likely requires multiple exp runs even though adding
__BSD_VISIBLE guards is easy).
o FreeBSD defines *enc() and *dec() functions always, but
Linux never does. We choose to be permissive here since
it's difficult to provide them for sources that include
both (directly or indirectly).
Sponsored by: Netflix