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.
inet.h@3:43bbf986ce1e, 2019-01-24 (annotated)
- Committer:
- tkanas
- Date:
- Thu Jan 24 22:38:10 2019 +0000
- Revision:
- 3:43bbf986ce1e
debugging;
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| tkanas | 3:43bbf986ce1e | 1 | |
| tkanas | 3:43bbf986ce1e | 2 | uint16_t htons (uint16_t x) { |
| tkanas | 3:43bbf986ce1e | 3 | #if BYTE_ORDER == BIG_ENDIAN |
| tkanas | 3:43bbf986ce1e | 4 | return x; |
| tkanas | 3:43bbf986ce1e | 5 | #elif BYTE_ORDER == LITTLE_ENDIAN |
| tkanas | 3:43bbf986ce1e | 6 | return __bswap_16 (x); |
| tkanas | 3:43bbf986ce1e | 7 | #else |
| tkanas | 3:43bbf986ce1e | 8 | # error "What kind of system is this?" |
| tkanas | 3:43bbf986ce1e | 9 | #endif |
| tkanas | 3:43bbf986ce1e | 10 | } |
| tkanas | 3:43bbf986ce1e | 11 | |
| tkanas | 3:43bbf986ce1e | 12 | uint16_t ntohs (uint16_t x) { |
| tkanas | 3:43bbf986ce1e | 13 | #if BYTE_ORDER == BIG_ENDIAN |
| tkanas | 3:43bbf986ce1e | 14 | return x; |
| tkanas | 3:43bbf986ce1e | 15 | #elif BYTE_ORDER == LITTLE_ENDIAN |
| tkanas | 3:43bbf986ce1e | 16 | return __bswap_16 (x); |
| tkanas | 3:43bbf986ce1e | 17 | #else |
| tkanas | 3:43bbf986ce1e | 18 | # error "What kind of system is this?" |
| tkanas | 3:43bbf986ce1e | 19 | #endif |
| tkanas | 3:43bbf986ce1e | 20 | } |