Commit c8a6fa91 authored by Daniel Bratell's avatar Daniel Bratell Committed by Commit Bot

[jumbo] Fixing collision between wtf ntohs and Windows ntohs

A recent change in blink added a dependency on services/network which
indirectly use winsock2.h for htons a ntohs. Since blink uses its custom
ntohs and htons for Windows, those clash. This changes so that blink also
uses winsock2.h for htons, ntohs.

Bug: 839982
Change-Id: I5bebce4e62227512da2c922dc41a564ce442f388
Reviewed-on: https://chromium-review.googlesource.com/1070973Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#561469}
parent f3eac2a3
...@@ -38,37 +38,7 @@ ...@@ -38,37 +38,7 @@
#endif #endif
#if defined(OS_WIN) #if defined(OS_WIN)
#include <winsock2.h>
#include "third_party/blink/renderer/platform/wtf/byte_swap.h"
#if defined(ARCH_CPU_BIG_ENDIAN)
inline uint16_t ntohs(uint16_t x) {
return x;
}
inline uint16_t htons(uint16_t x) {
return x;
}
inline uint32_t ntohl(uint32_t x) {
return x;
}
inline uint32_t htonl(uint32_t x) {
return x;
}
#else
inline uint16_t ntohs(uint16_t x) {
return WTF::Bswap16(x);
}
inline uint16_t htons(uint16_t x) {
return WTF::Bswap16(x);
}
inline uint32_t ntohl(uint32_t x) {
return WTF::Bswap32(x);
}
inline uint32_t htonl(uint32_t x) {
return WTF::Bswap32(x);
}
#endif
#endif // defined(OS_WIN) #endif // defined(OS_WIN)
#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_WTF_BYTE_ORDER_H_ #endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_WTF_BYTE_ORDER_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment