Remove __native_client__ support

NaCL was deprecated in 2020 and EOL in in ChromeOS 138:
https://developer.chrome.com/docs/native-client

Bug: None
Change-Id: I1d59dff4c3358876eaa16518eb0e8c3275467c5c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/402422
Commit-Queue: Philipp Hancke <phancke@meta.com>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#45231}
diff --git a/g3doc/supported-platforms-and-compilers.md b/g3doc/supported-platforms-and-compilers.md
index 69a1d1f..32d03f5 100644
--- a/g3doc/supported-platforms-and-compilers.md
+++ b/g3doc/supported-platforms-and-compilers.md
@@ -32,3 +32,6 @@
 Other compilers are not officially supported (which means there is no CI
 coverage for them) but patches to keep WebRTC working with them are welcomed by
 the WebRTC Team.
+
+For Microsofts Visual C++ compiler the minimum supported version is `_MSC_VER 1929`
+which means  Visual Studio 2019 version 16.11 or higher.
diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn
index fdf70e2..62268d9 100644
--- a/rtc_base/BUILD.gn
+++ b/rtc_base/BUILD.gn
@@ -1792,8 +1792,8 @@
     "//third_party/abseil-cpp/absl/algorithm:container",
     "//third_party/abseil-cpp/absl/base:core_headers",
     "//third_party/abseil-cpp/absl/memory",
+    "//third_party/abseil-cpp/absl/strings",
     "//third_party/abseil-cpp/absl/strings:string_view",
-    "//third_party/abseil-cpp/absl/strings:strings",
   ]
   if (is_fuchsia) {
     deps += [ "//third_party/fuchsia-sdk/sdk/pkg/zx" ]
diff --git a/rtc_base/async_dns_resolver.cc b/rtc_base/async_dns_resolver.cc
index 86ce421..b11175a 100644
--- a/rtc_base/async_dns_resolver.cc
+++ b/rtc_base/async_dns_resolver.cc
@@ -43,15 +43,6 @@
 
 namespace {
 
-#ifdef __native_client__
-int ResolveHostname(absl::string_view hostname,
-                    int family,
-                    std::vector<IPAddress>* addresses) {
-  RTC_DCHECK_NOTREACHED();
-  RTC_LOG(LS_WARNING) << "ResolveHostname() is not implemented for NaCl";
-  return -1;
-}
-#else   // notdef(__native_client__)
 int ResolveHostname(absl::string_view hostname,
                     int family,
                     std::vector<IPAddress>& addresses) {
@@ -94,7 +85,6 @@
   freeaddrinfo(result);
   return 0;
 }
-#endif  // !__native_client__
 
 // Special task posting for Mac/iOS
 #if defined(WEBRTC_MAC) || defined(WEBRTC_IOS)
diff --git a/rtc_base/byte_order.h b/rtc_base/byte_order.h
index ba58571..3a9bfe4 100644
--- a/rtc_base/byte_order.h
+++ b/rtc_base/byte_order.h
@@ -17,7 +17,7 @@
 
 #include "rtc_base/system/arch.h"  // IWYU pragma: keep
 
-#if defined(WEBRTC_POSIX) && !defined(__native_client__)
+#if defined(WEBRTC_POSIX)
 #include <arpa/inet.h>  // IWYU pragma: keep
 #endif
 
@@ -39,7 +39,7 @@
 #define le32toh(v) OSSwapLittleToHostInt32(v)
 #define le64toh(v) OSSwapLittleToHostInt64(v)
 
-#elif defined(WEBRTC_WIN) || defined(__native_client__)
+#elif defined(WEBRTC_WIN)
 
 #if defined(WEBRTC_WIN)
 #include <winsock2.h>
@@ -62,10 +62,6 @@
 #define htobe64(v) _byteswap_uint64(v)
 #define be64toh(v) _byteswap_uint64(v)
 #endif  // defined(WEBRTC_WIN)
-#if defined(__native_client__)
-#define htobe64(v) __builtin_bswap64(v)
-#define be64toh(v) __builtin_bswap64(v)
-#endif  // defined(__native_client__)
 
 #elif defined(WEBRTC_ARCH_BIG_ENDIAN)
 #define htobe16(v) (v)
@@ -82,10 +78,6 @@
 #define htobe64(v) (v)
 #define be64toh(v) (v)
 #endif  // defined(WEBRTC_WIN)
-#if defined(__native_client__)
-#define htobe64(v) (v)
-#define be64toh(v) (v)
-#endif  // defined(__native_client__)
 #else
 #error WEBRTC_ARCH_BIG_ENDIAN or WEBRTC_ARCH_LITTLE_ENDIAN must be defined.
 #endif  // defined(WEBRTC_ARCH_LITTLE_ENDIAN)
diff --git a/rtc_base/checks.cc b/rtc_base/checks.cc
index ca7cabf6..a2e4079 100644
--- a/rtc_base/checks.cc
+++ b/rtc_base/checks.cc
@@ -30,8 +30,6 @@
 
 #if defined(WEBRTC_WIN)
 #define LAST_SYSTEM_ERROR (::GetLastError())
-#elif defined(__native_client__) && __native_client__
-#define LAST_SYSTEM_ERROR (0)
 #elif defined(WEBRTC_POSIX)
 #include <cerrno>
 #define LAST_SYSTEM_ERROR (errno)
diff --git a/rtc_base/internal/default_socket_server.cc b/rtc_base/internal/default_socket_server.cc
index 1ebe391..d49c2bb 100644
--- a/rtc_base/internal/default_socket_server.cc
+++ b/rtc_base/internal/default_socket_server.cc
@@ -13,21 +13,12 @@
 #include <memory>
 
 #include "rtc_base/socket_server.h"
-
-#if defined(__native_client__)
-#include "rtc_base/null_socket_server.h"
-#else
 #include "rtc_base/physical_socket_server.h"
-#endif
 
 namespace webrtc {
 
 std::unique_ptr<SocketServer> CreateDefaultSocketServer() {
-#if defined(__native_client__)
-  return std::unique_ptr<SocketServer>(new NullSocketServer);
-#else
   return std::unique_ptr<SocketServer>(new PhysicalSocketServer);
-#endif
 }
 
 }  // namespace webrtc
diff --git a/rtc_base/ip_address.cc b/rtc_base/ip_address.cc
index d6b8cf5..179bc37 100644
--- a/rtc_base/ip_address.cc
+++ b/rtc_base/ip_address.cc
@@ -25,8 +25,6 @@
 #ifdef OPENBSD
 #include <netinet/in_systm.h>
 #endif
-#ifndef __native_client__
-#endif
 #include <netdb.h>
 #endif
 
diff --git a/rtc_base/logging.h b/rtc_base/logging.h
index c24826d..0023684 100644
--- a/rtc_base/logging.h
+++ b/rtc_base/logging.h
@@ -672,9 +672,6 @@
 #define RTC_LOG_GLE(sev) RTC_LOG_GLE_EX(sev, static_cast<int>(GetLastError()))
 #define RTC_LOG_ERR_EX(sev, err) RTC_LOG_GLE_EX(sev, err)
 #define RTC_LOG_ERR(sev) RTC_LOG_GLE(sev)
-#elif defined(__native_client__) && __native_client__
-#define RTC_LOG_ERR_EX(sev, err) RTC_LOG(sev)
-#define RTC_LOG_ERR(sev) RTC_LOG(sev)
 #elif defined(WEBRTC_POSIX)
 #define RTC_LOG_ERR_EX(sev, err) RTC_LOG_ERRNO_EX(sev, err)
 #define RTC_LOG_ERR(sev) RTC_LOG_ERRNO(sev)
diff --git a/rtc_base/net_helpers.cc b/rtc_base/net_helpers.cc
index 51db569..6edd2c7 100644
--- a/rtc_base/net_helpers.cc
+++ b/rtc_base/net_helpers.cc
@@ -17,11 +17,10 @@
 #if defined(WEBRTC_WIN)
 #include <ws2spi.h>
 #include <ws2tcpip.h>
-
 #endif
-#if defined(WEBRTC_POSIX) && !defined(__native_client__)
+#if defined(WEBRTC_POSIX)
 #include <arpa/inet.h>
-#endif  // defined(WEBRTC_POSIX) && !defined(__native_client__)
+#endif  // defined(WEBRTC_POSIX)
 
 namespace webrtc {
 
diff --git a/rtc_base/net_test_helpers.cc b/rtc_base/net_test_helpers.cc
index f21a0eb..91ad839 100644
--- a/rtc_base/net_test_helpers.cc
+++ b/rtc_base/net_test_helpers.cc
@@ -18,18 +18,18 @@
 
 #include "rtc_base/win/windows_version.h"
 #endif
-#if defined(WEBRTC_POSIX) && !defined(__native_client__)
+#if defined(WEBRTC_POSIX)
 #if defined(WEBRTC_ANDROID)
 #include "rtc_base/ifaddrs_android.h"
 #else
 #include <ifaddrs.h>
 #endif
-#endif  // defined(WEBRTC_POSIX) && !defined(__native_client__)
+#endif  // defined(WEBRTC_POSIX)
 
 namespace webrtc {
 
 bool HasIPv4Enabled() {
-#if defined(WEBRTC_POSIX) && !defined(__native_client__)
+#if defined(WEBRTC_POSIX)
   bool has_ipv4 = false;
   struct ifaddrs* ifa;
   if (getifaddrs(&ifa) < 0) {
@@ -88,7 +88,7 @@
     }
   }
   return false;
-#elif defined(WEBRTC_POSIX) && !defined(__native_client__)
+#elif defined(WEBRTC_POSIX)
   bool has_ipv6 = false;
   struct ifaddrs* ifa;
   if (getifaddrs(&ifa) < 0) {
@@ -106,4 +106,5 @@
   return true;
 #endif
 }
+
 }  // namespace webrtc
diff --git a/rtc_base/network.cc b/rtc_base/network.cc
index 5a0f0df..4798b84 100644
--- a/rtc_base/network.cc
+++ b/rtc_base/network.cc
@@ -55,7 +55,7 @@
 #include "rtc_base/experiments/field_trial_parser.h"
 #include "rtc_base/string_utils.h"
 #include "rtc_base/win32.h"
-#elif !defined(__native_client__)
+#else
 #include "rtc_base/ifaddrs_converter.h"
 #endif
 // IWYU pragma: end_keep
@@ -158,7 +158,6 @@
   }
 }
 
-#if !defined(__native_client__)
 bool IsIgnoredIPv6(bool allow_mac_based_ipv6, const InterfaceAddress& ip) {
   if (ip.family() != AF_INET6) {
     return false;
@@ -186,7 +185,6 @@
 
   return false;
 }
-#endif  // !defined(__native_client__)
 
 // Note: consider changing to const Network* as arguments
 // if/when considering other changes that should not trigger
@@ -573,17 +571,7 @@
   UpdateNetworksOnce();
 }
 
-#if defined(__native_client__)
-
-bool BasicNetworkManager::CreateNetworks(
-    bool include_ignored,
-    std::vector<std::unique_ptr<Network>>* networks) const {
-  RTC_DCHECK_NOTREACHED();
-  RTC_LOG(LS_WARNING) << "BasicNetworkManager doesn't work on NaCl yet";
-  return false;
-}
-
-#elif defined(WEBRTC_POSIX)
+#if defined(WEBRTC_POSIX)
 NetworkMonitorInterface::InterfaceInfo BasicNetworkManager::GetInterfaceInfo(
     struct ifaddrs* cursor) const {
   if (cursor->ifa_flags & IFF_LOOPBACK) {
diff --git a/rtc_base/physical_socket_server.cc b/rtc_base/physical_socket_server.cc
index 8a2f3f2..2116af1 100644
--- a/rtc_base/physical_socket_server.cc
+++ b/rtc_base/physical_socket_server.cc
@@ -69,8 +69,6 @@
 
 #if defined(WEBRTC_WIN)
 #define LAST_SYSTEM_ERROR (::GetLastError())
-#elif defined(__native_client__) && __native_client__
-#define LAST_SYSTEM_ERROR (0)
 #elif defined(WEBRTC_POSIX)
 #define LAST_SYSTEM_ERROR (errno)
 #endif  // WEBRTC_WIN
@@ -80,7 +78,7 @@
 typedef void* SockOptArg;
 #endif  // WEBRTC_POSIX
 
-#if defined(WEBRTC_POSIX) && !defined(WEBRTC_MAC) && !defined(__native_client__)
+#if defined(WEBRTC_POSIX) && !defined(WEBRTC_MAC)
 int64_t GetSocketRecvTimestamp(int socket) {
   struct timeval tv_ioctl;
   int ret = ioctl(socket, SIOCGSTAMP, &tv_ioctl);
@@ -700,7 +698,7 @@
       *slevel = IPPROTO_IP;
       *sopt = IP_DONTFRAGMENT;
       break;
-#elif defined(WEBRTC_MAC) || defined(BSD) || defined(__native_client__)
+#elif defined(WEBRTC_MAC) || defined(BSD)
       RTC_LOG(LS_WARNING) << "Socket::OPT_DONTFRAGMENT not supported.";
       return -1;
 #elif defined(WEBRTC_POSIX)
diff --git a/rtc_base/platform_thread.cc b/rtc_base/platform_thread.cc
index 7f11696b..861daca 100644
--- a/rtc_base/platform_thread.cc
+++ b/rtc_base/platform_thread.cc
@@ -47,7 +47,7 @@
 #if defined(WEBRTC_WIN)
   return SetThreadPriority(GetCurrentThread(),
                            Win32PriorityFromThreadPriority(priority)) != FALSE;
-#elif defined(__native_client__) || defined(WEBRTC_FUCHSIA) || \
+#elif defined(WEBRTC_FUCHSIA) || \
     (defined(__EMSCRIPTEN__) && !defined(__EMSCRIPTEN_PTHREADS__))
   // Setting thread priorities is not supported in NaCl, Fuchsia or Emscripten
   // without pthreads.
diff --git a/rtc_base/socket_address.cc b/rtc_base/socket_address.cc
index f9c21f9..98455f8 100644
--- a/rtc_base/socket_address.cc
+++ b/rtc_base/socket_address.cc
@@ -20,8 +20,6 @@
 #if defined(OPENBSD)
 #include <netinet/in_systm.h>
 #endif
-#if !defined(__native_client__)
-#endif
 #endif
 
 #include "absl/strings/string_view.h"