Browse Source

Fixed htonll fallback implementation

Paul-Louis Ageneau 4 years ago
parent
commit
9a7b672d6e
2 changed files with 2 additions and 2 deletions
  1. 1 1
      include/rtc/rtp.hpp
  2. 1 1
      src/impl/wstransport.cpp

+ 1 - 1
include/rtc/rtp.hpp

@@ -33,7 +33,7 @@
 
 #ifndef htonll
 #define htonll(x)                                                                                  \
-	((uint64_t)htonl(((uint64_t)(x)&0xFFFFFFFF) << 32) | (uint64_t)htonl((uint64_t)(x) >> 32))
+	((uint64_t)(((uint64_t)htonl((uint32_t)(x))) << 32) | (uint64_t)htonl((uint32_t)((x) >> 32)))
 #endif
 #ifndef ntohll
 #define ntohll(x) htonll(x)

+ 1 - 1
src/impl/wstransport.cpp

@@ -39,7 +39,7 @@
 
 #ifndef htonll
 #define htonll(x)                                                                                  \
-	((uint64_t)htonl(((uint64_t)(x)&0xFFFFFFFF) << 32) | (uint64_t)htonl((uint64_t)(x) >> 32))
+	((uint64_t)(((uint64_t)htonl((uint32_t)(x))) << 32) | (uint64_t)htonl((uint32_t)((x) >> 32)))
 #endif
 #ifndef ntohll
 #define ntohll(x) htonll(x)