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
byteorder functions in capital letters? #5959
Comments
@kaspar030 I guess because our coding conventions state that macros should be upper case. For portability you can find the POSIX naming in |
(which also should help you with portability since the macro is exactly where other OSs would expect it to be |
Well, that's the thing. They are static inline functions, not macros. |
See #4812 |
So with the current state of byteorder.h, you don't remember the reason for the function names being uppercase? |
Not really, but I guess the HTONS etc. wrapper macros are primarily there for legacy reasons. @Kijewski? |
They're not macros. :) |
That's even more confusing ^^. |
I think they were macros at first but were changed into inline functions to
make it easier to see programming mistakes.
|
Fine by me. |
I would suspected that non-RIOT code rather expects these functions to be macros and thus to be uppercase. |
Just checked, in my system headers they are declared as functions. |
True. |
According to the POSIX-specification they are functions. |
RIOT's
byteorder.h
definesNTOHL()
as capital static inline functions. Does anyone remember the reason for not usingntohl()
et al?Like this it is really inconvenient for code also used on other platforms (see kaspar030/sock#2).
The text was updated successfully, but these errors were encountered: