Commit graph

2 commits

Author SHA1 Message Date
Francesco Giancane 1173ce32f6 endian.h: define non-standard symbols for endian handling
BSDs and Unices defined some non standardised functions and symbols used
for endianness handling: converting from Little Endian to Big Endian,
converting from Host to a specific representation, converting from a
specific representation to Host.

With this commit, a modified version of those symbols provided by
FreeBSD is imported.

The license of the imported code is still 2-Clause BSD.

Signed-off-by: Francesco Giancane <francesco.giancane@accenture.com>
Closes https://github.com/espressif/esp-idf/pull/4784
2020-04-29 23:47:51 +02:00
Francesco Giancane 6f8ce38f99 Introduce <endian.h> compatibility header
Programs and libraries using compiler and system information about
endianness often include the system header `<endian.h>`.

In `xtensa-gcc` compiler with `newlib` distribution, that file is located in
`<machine/endian.h>`; this means that `#include <endian.h>` would fail
at compile time.

This commit fixes the issue by adding a compatibility `<endian.h>`
header which in turn just includes `<machine/endian.h>`.

Signed-off-by: Francesco Giancane <francesco.giancane@accenture.com>
Merges https://github.com/espressif/esp-idf/pull/4784
2020-04-29 23:47:51 +02:00