Remove rtc::EnsureWinsockInit and g_winsockinit.
In the effort of enabling -Wglobal-constructors and
-Wexit-time-destructors, WebRTC has to remove the Winsock global
initializer.
This will also remove it from Chromium (since it was unused).
After this CL, applications will have to explicitly initialize Winsock
before using WebRTC, this can be done by using the class
rtc::WinsockInitializer provided in rtc_base/win32socketinit.h.
Bug: webrtc:9693, webrtc:9754
Change-Id: I4aae12ff43671ef2713a6fc4592e20759dc6b495
Reviewed-on: https://webrtc-review.googlesource.com/99660
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24903}
diff --git a/test/test_main.cc b/test/test_main.cc
index 5bb2c10..c8d0b1b 100644
--- a/test/test_main.cc
+++ b/test/test_main.cc
@@ -21,6 +21,10 @@
#include "test/testsupport/fileutils.h"
#include "test/testsupport/perf_test.h"
+#if defined(WEBRTC_WIN)
+#include "rtc_base/win32socketinit.h"
+#endif
+
#if defined(WEBRTC_IOS)
#include "test/ios/test_support.h"
@@ -89,6 +93,10 @@
webrtc::field_trial::InitFieldTrialsFromString(FLAG_force_fieldtrials);
webrtc::metrics::Enable();
+#if defined(WEBRTC_WIN)
+ rtc::WinsockInitializer winsock_init;
+#endif
+
rtc::LogMessage::SetLogToStderr(FLAG_logs);
// Ensure that main thread gets wrapped as an rtc::Thread.