webrtc_m130/rtc_base/net_helpers.h

35 lines
1.0 KiB
C
Raw Normal View History

/*
* Copyright 2008 The WebRTC Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef RTC_BASE_NET_HELPERS_H_
#define RTC_BASE_NET_HELPERS_H_
#if defined(WEBRTC_POSIX)
#include <sys/socket.h> // IWYU pragma: export
#elif WEBRTC_WIN
#include <winsock2.h> // NOLINT
Revert "Refactor rtc_base build targets." This reverts commit 69241a93fb14f6527a26d5c94dde879013012d2a. Reason for revert: Breaks WebRTC roll into Chromium. Original change's description: > Refactor rtc_base build targets. > > The "//rtc_base:rtc_base" build target has historically been one of the > biggest targets in the WebRTC build. Big targets are the main source of > circular dependencies and non-API types leakage. > > This CL is a step forward into splitting "//rtc_base:rtc_base" into > smaller targets (as originally started in 2018). > > The only non-automated changes are (like re-wiring the build system): > * The creation of //rtc_base/async_resolver.{h,cc} which allows to > break a circular dependency (is has been extracted from > //rtc_base/net_helpers.{h,cc}). > * The creation of //rtc_base/internal/default_socket_server.{h,cc} to > break another circular dependency. > > Bug: webrtc:9987 > Change-Id: I0c8f5e7efe2c8fd8e6bffa0d6dd2dd494cf3df02 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196903 > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> > Reviewed-by: Harald Alvestrand <hta@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#32941} TBR=mbonadei@webrtc.org,hta@webrtc.org # Not skipping CQ checks because original CL landed > 1 day ago. No-Try: True Bug: webrtc:9987 Change-Id: I1e36ad64cc60092f38d6886153a94f1a58339256 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/201840 Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Markus Handell <handellm@webrtc.org> Cr-Commit-Position: refs/heads/master@{#32986}
2021-01-14 21:03:55 +00:00
Reland "Refactor rtc_base build targets." This is a reland of 69241a93fb14f6527a26d5c94dde879013012d2a Fix: The problem was related to NO_MAIN_THREAD_WRAPPING, which affects https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/rtc_base/thread.cc;l=257-263;drc=7acc2d9fe3a6e3c4d8881d2bdfc9b8968a724cd5. The original CL didn't attach the definition of the macro NO_MAIN_THREAD_WRAPPING when building for Chromium (which doesn't have to be related to //rtc_base anymore but to //rtc_base:threading). Original change's description: > Refactor rtc_base build targets. > > The "//rtc_base:rtc_base" build target has historically been one of the > biggest targets in the WebRTC build. Big targets are the main source of > circular dependencies and non-API types leakage. > > This CL is a step forward into splitting "//rtc_base:rtc_base" into > smaller targets (as originally started in 2018). > > The only non-automated changes are (like re-wiring the build system): > * The creation of //rtc_base/async_resolver.{h,cc} which allows to > break a circular dependency (is has been extracted from > //rtc_base/net_helpers.{h,cc}). > * The creation of //rtc_base/internal/default_socket_server.{h,cc} to > break another circular dependency. > > Bug: webrtc:9987 > Change-Id: I0c8f5e7efe2c8fd8e6bffa0d6dd2dd494cf3df02 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196903 > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> > Reviewed-by: Harald Alvestrand <hta@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#32941} Bug: webrtc:9987 Change-Id: I7cdf49d2aac8357f1f50f90010bf2c2f62fa19f6 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/202021 Reviewed-by: Niels Moller <nisse@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/master@{#33001}
2021-01-15 10:41:01 +01:00
#include "rtc_base/win32.h"
#endif
Revert "Refactor rtc_base build targets." This reverts commit 69241a93fb14f6527a26d5c94dde879013012d2a. Reason for revert: Breaks WebRTC roll into Chromium. Original change's description: > Refactor rtc_base build targets. > > The "//rtc_base:rtc_base" build target has historically been one of the > biggest targets in the WebRTC build. Big targets are the main source of > circular dependencies and non-API types leakage. > > This CL is a step forward into splitting "//rtc_base:rtc_base" into > smaller targets (as originally started in 2018). > > The only non-automated changes are (like re-wiring the build system): > * The creation of //rtc_base/async_resolver.{h,cc} which allows to > break a circular dependency (is has been extracted from > //rtc_base/net_helpers.{h,cc}). > * The creation of //rtc_base/internal/default_socket_server.{h,cc} to > break another circular dependency. > > Bug: webrtc:9987 > Change-Id: I0c8f5e7efe2c8fd8e6bffa0d6dd2dd494cf3df02 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196903 > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> > Reviewed-by: Harald Alvestrand <hta@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#32941} TBR=mbonadei@webrtc.org,hta@webrtc.org # Not skipping CQ checks because original CL landed > 1 day ago. No-Try: True Bug: webrtc:9987 Change-Id: I1e36ad64cc60092f38d6886153a94f1a58339256 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/201840 Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Markus Handell <handellm@webrtc.org> Cr-Commit-Position: refs/heads/master@{#32986}
2021-01-14 21:03:55 +00:00
#include "absl/strings/string_view.h"
#include "rtc_base/system/rtc_export.h"
namespace rtc {
// rtc namespaced wrappers for inet_ntop and inet_pton so we can avoid
// the windows-native versions of these.
const char* inet_ntop(int af, const void* src, char* dst, socklen_t size);
int inet_pton(int af, absl::string_view src, void* dst);
} // namespace rtc
#endif // RTC_BASE_NET_HELPERS_H_