Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: inet.h
- Revision:
- 2:6c2e2cdea46a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inet.h Sun Jan 20 13:47:43 2019 +0000 @@ -0,0 +1,20 @@ + +uint16_t htons (uint16_t x) { +#if BYTE_ORDER == BIG_ENDIAN + return x; +#elif BYTE_ORDER == LITTLE_ENDIAN + return __bswap_16 (x); +#else +# error "What kind of system is this?" +#endif +} + +uint16_t ntohs (uint16_t x) { +#if BYTE_ORDER == BIG_ENDIAN + return x; +#elif BYTE_ORDER == LITTLE_ENDIAN + return __bswap_16 (x); +#else +# error "What kind of system is this?" +#endif +} \ No newline at end of file