diff options
Diffstat (limited to 'daemons/gptp/windows/daemon_cl/platform.cpp')
-rw-r--r-- | daemons/gptp/windows/daemon_cl/platform.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/daemons/gptp/windows/daemon_cl/platform.cpp b/daemons/gptp/windows/daemon_cl/platform.cpp index 12f9aa56..a6ec4d50 100644 --- a/daemons/gptp/windows/daemon_cl/platform.cpp +++ b/daemons/gptp/windows/daemon_cl/platform.cpp @@ -53,3 +53,13 @@ uint16_t PLAT_ntohs( uint16_t s ) { uint32_t PLAT_ntohl( uint32_t l ) { return ntohl( l ); } + +uint64_t PLAT_htonll(uint64_t x) +{ + return ( (htonl(1) == 1) ? x : ((uint64_t)htonl((x) & 0xFFFFFFFF) << 32) | htonl((x) >> 32) ); +} + +uint64_t PLAT_ntohll(uint64_t x) +{ + return( (ntohl(1) == 1) ? x : ((uint64_t)ntohl((x) & 0xFFFFFFFF) << 32) | ntohl((x) >> 32) ); +} |