-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce <endian.h> compatibility header (IDFGH-2715) #4784
Introduce <endian.h> compatibility header (IDFGH-2715) #4784
Conversation
@fgiancane8 Thanks for your contribution. |
Thanks for the PR @fgiancane8. It seems that we also need a few more definitions in endian.h, such as htobe16, be16toh, and so on. Can either leave this to you if you like, or we can add another commit with the rest of the definitions on top of yours. |
Hi @igrr , You are right indeed. I just searched for the symbols I needed and did not check for the fully compliance. I did a quick search inside system xtensa compiler and they are not defined elsewhere. Of course if you already did the work, I am happy with merging my commit with yours. |
Perhaps you can check an existing BSD licensed version of endian.h and copy it as whole, retaining the copyright headers. |
Hi @igrr , from
Being non-standard, the requirement to have it in the compatibility layer is questionable. What do you think? |
@igrr , I tested them with this code:
No warnings and no issue so far with maximum compiler strictness. |
hi @igrr , |
Hi @igrr , |
@igrr , @Alvin1Zhang Thanks, |
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>
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>
@fgiancane8 Thanks for your contribution and updates, and sorry for the slow turnaround, really appreciate your patience waiting for our reply. We will check and then provide feedback. Thanks. |
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 #4784
Programs and libraries using compiler and system information about
endianness often include the system header
<endian.h>
.In
xtensa-gcc
compiler withnewlib
distribution, that file is located in<machine/endian.h>
; this means that#include <endian.h>
would failat 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