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

Side by Side Diff: ppapi/shared_impl/private/net_address_private_impl.cc

Issue 2822233004: ppapi: Include <netinet/in.h> for sockaddr_in{6}. (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ppapi/shared_impl/private/net_address_private_impl.h" 5 #include "ppapi/shared_impl/private/net_address_private_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include <string> 10 #include <string>
11 11
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/strings/stringprintf.h" 13 #include "base/strings/stringprintf.h"
14 #include "build/build_config.h" 14 #include "build/build_config.h"
15 #include "ppapi/c/pp_var.h" 15 #include "ppapi/c/pp_var.h"
16 #include "ppapi/c/private/ppb_net_address_private.h" 16 #include "ppapi/c/private/ppb_net_address_private.h"
17 #include "ppapi/shared_impl/proxy_lock.h" 17 #include "ppapi/shared_impl/proxy_lock.h"
18 #include "ppapi/shared_impl/var.h" 18 #include "ppapi/shared_impl/var.h"
19 #include "ppapi/thunk/thunk.h" 19 #include "ppapi/thunk/thunk.h"
20 20
21 #if defined(OS_WIN) 21 #if defined(OS_WIN)
22 #include <windows.h> 22 #include <windows.h>
23 #include <winsock2.h> 23 #include <winsock2.h>
24 #include <ws2tcpip.h> 24 #include <ws2tcpip.h>
25 #elif defined(OS_POSIX) && !defined(OS_NACL) 25 #elif defined(OS_POSIX) && !defined(OS_NACL)
26 #include <arpa/inet.h> 26 #include <arpa/inet.h>
27 #include <netinet/in.h>
27 #include <sys/socket.h> 28 #include <sys/socket.h>
28 #include <sys/types.h> 29 #include <sys/types.h>
29 #endif 30 #endif
30 31
31 #if defined(OS_MACOSX) 32 #if defined(OS_MACOSX)
32 // This is a bit evil, but it's standard operating procedure for |s6_addr|.... 33 // This is a bit evil, but it's standard operating procedure for |s6_addr|....
33 #define s6_addr16 __u6_addr.__u6_addr16 34 #define s6_addr16 __u6_addr.__u6_addr16
34 #endif 35 #endif
35 36
36 #if defined(OS_WIN) 37 #if defined(OS_WIN)
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 ipv6_addr->port = ConvertToNetEndian16(net_addr->port); 584 ipv6_addr->port = ConvertToNetEndian16(net_addr->port);
584 585
585 static_assert(sizeof(ipv6_addr->addr) == kIPv6AddressSize, 586 static_assert(sizeof(ipv6_addr->addr) == kIPv6AddressSize,
586 "mismatched IPv6 address size"); 587 "mismatched IPv6 address size");
587 memcpy(ipv6_addr->addr, net_addr->address, kIPv6AddressSize); 588 memcpy(ipv6_addr->addr, net_addr->address, kIPv6AddressSize);
588 589
589 return true; 590 return true;
590 } 591 }
591 592
592 } // namespace ppapi 593 } // namespace ppapi
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698