Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Unified Diff: third_party/libjingle/overrides/talk/base/byteorder.h

Issue 9600066: Roll libjingle to r124 and roll webrtc to 1888. (Closed) Base URL: https://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/libjingle/libjingle.gyp ('k') | third_party/libjingle/overrides/talk/base/win32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libjingle/overrides/talk/base/byteorder.h
===================================================================
--- third_party/libjingle/overrides/talk/base/byteorder.h (revision 126778)
+++ third_party/libjingle/overrides/talk/base/byteorder.h (working copy)
@@ -33,8 +33,8 @@
#endif
#ifdef WIN32
+#include <stdlib.h>
#include <winsock2.h>
-#include "talk/base/win32.h"
#endif
#include "talk/base/basictypes.h"
@@ -143,11 +143,22 @@
}
inline uint16 HostToNetwork16(uint16 n) {
+#ifdef WIN32
+ // This and below _byteswap_* are to remove the dependency to ws2_32.dll
+ // especially for chrome, where we don't load the ws2_32.dll in the render
+ // process. This is correct only on little-endian machines.
+ return _byteswap_ushort(n);
+#else
return htons(n);
+#endif
}
inline uint32 HostToNetwork32(uint32 n) {
+#ifdef WIN32
+ return _byteswap_ulong(n);
+#else
return htonl(n);
+#endif
}
inline uint64 HostToNetwork64(uint64 n) {
@@ -156,11 +167,19 @@
}
inline uint16 NetworkToHost16(uint16 n) {
+#ifdef WIN32
+ return _byteswap_ushort(n);
+#else
return ntohs(n);
+#endif
}
inline uint32 NetworkToHost32(uint32 n) {
+#ifdef WIN32
+ return _byteswap_ulong(n);
+#else
return ntohl(n);
+#endif
}
inline uint64 NetworkToHost64(uint64 n) {
« no previous file with comments | « third_party/libjingle/libjingle.gyp ('k') | third_party/libjingle/overrides/talk/base/win32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698