diff options
Diffstat (limited to 'zencore/include')
| -rw-r--r-- | zencore/include/zencore/endian.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/zencore/include/zencore/endian.h b/zencore/include/zencore/endian.h index 27c831bb1..1f79a59e8 100644 --- a/zencore/include/zencore/endian.h +++ b/zencore/include/zencore/endian.h @@ -58,4 +58,40 @@ FromNetworkOrder(int64_t x) return ByteSwap(uint64_t(x)); } +inline uint16_t +ToNetworkOrder(uint16_t x) +{ + return ByteSwap(x); +} + +inline uint32_t +ToNetworkOrder(uint32_t x) +{ + return ByteSwap(x); +} + +inline uint64_t +ToNetworkOrder(uint64_t x) +{ + return ByteSwap(x); +} + +inline uint16_t +ToNetworkOrder(int16_t x) +{ + return ByteSwap(uint16_t(x)); +} + +inline uint32_t +ToNetworkOrder(int32_t x) +{ + return ByteSwap(uint32_t(x)); +} + +inline uint64_t +ToNetworkOrder(int64_t x) +{ + return ByteSwap(uint64_t(x)); +} + } // namespace zen |