Platform independent functions to convert integer formats.
More...
Platform independent functions to convert integer formats.
- Note
- Defined static inline to help optimization: it is fine, as they use only standard functions.
- Precondition
- On Linux, these macros require __DEFAULT_SOURCE to be defined ( DEFAULT_SOURCE is defined also by _GNU_SOURCE and
-std=gnuXY)
- See also
- https://man7.org/linux/man-pages/man3/endian.3.html
◆ c_hton16()
| static uint16_t c_hton16 |
( |
uint16_t |
x | ) |
|
|
inlinestatic |
◆ c_ntoh16()
| static uint16_t c_ntoh16 |
( |
uint16_t |
x | ) |
|
|
inlinestatic |
◆ c_hton32()
| static uint32_t c_hton32 |
( |
uint32_t |
x | ) |
|
|
inlinestatic |
◆ c_ntoh32()
| static uint32_t c_ntoh32 |
( |
uint32_t |
x | ) |
|
|
inlinestatic |
◆ c_hton64()
| static uint64_t c_hton64 |
( |
uint64_t |
x | ) |
|
|
inlinestatic |
◆ c_ntoh64()
| static uint64_t c_ntoh64 |
( |
uint64_t |
x | ) |
|
|
inlinestatic |