Remove support for ancient MSVC (<2008) and ancient glib (<2012)

Bug: None
Change-Id: I13907e0aafb3a68a0d6bd33c861a3ee6d167a952
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/400240
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#45201}
diff --git a/common_audio/third_party/ooura/fft_size_128/ooura_fft_sse2.cc b/common_audio/third_party/ooura/fft_size_128/ooura_fft_sse2.cc
index 7f0802d..64082db 100644
--- a/common_audio/third_party/ooura/fft_size_128/ooura_fft_sse2.cc
+++ b/common_audio/third_party/ooura/fft_size_128/ooura_fft_sse2.cc
@@ -20,20 +20,6 @@
 
 #if defined(WEBRTC_ARCH_X86_FAMILY)
 
-namespace {
-// These intrinsics were unavailable before VS 2008.
-// TODO(andrew): move to a common file.
-#if defined(_MSC_VER) && _MSC_VER < 1500
-static __inline __m128 _mm_castsi128_ps(__m128i a) {
-  return *(__m128*)&a;
-}
-static __inline __m128i _mm_castps_si128(__m128 a) {
-  return *(__m128i*)&a;
-}
-#endif
-
-}  // namespace
-
 void cft1st_128_SSE2(float* a) {
   const __m128 mm_swap_sign = _mm_load_ps(k_swap_sign);
   int j, k2;
diff --git a/examples/peerconnection/client/linux/main.cc b/examples/peerconnection/client/linux/main.cc
index 85c3c48..60b7b53 100644
--- a/examples/peerconnection/client/linux/main.cc
+++ b/examples/peerconnection/client/linux/main.cc
@@ -8,7 +8,6 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include <glib.h>
 #include <gtk/gtk.h>
 
 #include <cstdio>
@@ -72,16 +71,6 @@
 
 int main(int argc, char* argv[]) {
   gtk_init(&argc, &argv);
-// g_type_init API is deprecated (and does nothing) since glib 2.35.0, see:
-// https://mail.gnome.org/archives/commits-list/2012-November/msg07809.html
-#if !GLIB_CHECK_VERSION(2, 35, 0)
-  g_type_init();
-#endif
-// g_thread_init API is deprecated since glib 2.31.0, see release note:
-// http://mail.gnome.org/archives/gnome-announce-list/2011-October/msg00041.html
-#if !GLIB_CHECK_VERSION(2, 31, 0)
-  g_thread_init(NULL);
-#endif
 
   absl::ParseCommandLine(argc, argv);
 
diff --git a/modules/audio_device/BUILD.gn b/modules/audio_device/BUILD.gn
index 8a8235f..66f69fc 100644
--- a/modules/audio_device/BUILD.gn
+++ b/modules/audio_device/BUILD.gn
@@ -50,10 +50,6 @@
   deps = [ "../../api/audio:audio_device" ]
 }
 
-rtc_library("audio_device_config") {
-  sources = [ "audio_device_config.h" ]
-}
-
 rtc_library("audio_device_buffer") {
   sources = [
     "audio_device_buffer.cc",
@@ -257,7 +253,6 @@
   visibility = [ "*" ]
   deps = [
     ":audio_device_buffer",
-    ":audio_device_config",
     ":audio_device_default",
     ":audio_device_dummy",
     ":audio_device_generic",
diff --git a/modules/audio_device/audio_device_config.h b/modules/audio_device/audio_device_config.h
deleted file mode 100644
index fa51747..0000000
--- a/modules/audio_device/audio_device_config.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- *  Copyright (c) 2011 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 AUDIO_DEVICE_AUDIO_DEVICE_CONFIG_H_
-#define AUDIO_DEVICE_AUDIO_DEVICE_CONFIG_H_
-
-// Enumerators
-//
-enum { GET_MIC_VOLUME_INTERVAL_MS = 1000 };
-
-// Platform specifics
-//
-#if defined(_WIN32)
-#if (_MSC_VER >= 1400)
-#if !defined(WEBRTC_DUMMY_FILE_DEVICES)
-// Windows Core Audio is the default audio layer in Windows.
-// Only supported for VS 2005 and higher.
-#define WEBRTC_WINDOWS_CORE_AUDIO_BUILD
-#endif
-#endif
-#endif
-
-#endif  // AUDIO_DEVICE_AUDIO_DEVICE_CONFIG_H_
diff --git a/modules/audio_device/audio_device_impl.cc b/modules/audio_device/audio_device_impl.cc
index 2a522c0..b2ffa53 100644
--- a/modules/audio_device/audio_device_impl.cc
+++ b/modules/audio_device/audio_device_impl.cc
@@ -21,16 +21,13 @@
 #include "api/make_ref_counted.h"
 #include "api/scoped_refptr.h"
 #include "api/task_queue/task_queue_factory.h"
-#include "modules/audio_device/audio_device_config.h"  // IWYU pragma: keep
 #include "modules/audio_device/audio_device_generic.h"
 #include "rtc_base/checks.h"
 #include "rtc_base/logging.h"
 #include "system_wrappers/include/metrics.h"
 
-#if defined(_WIN32)
-#if defined(WEBRTC_WINDOWS_CORE_AUDIO_BUILD)
+#if defined(WEBRTC_WIN)
 #include "modules/audio_device/win/audio_device_core_win.h"
-#endif
 #elif defined(WEBRTC_LINUX)
 #if defined(WEBRTC_ENABLE_LINUX_ALSA)
 #include "modules/audio_device/linux/audio_device_alsa_linux.h"
@@ -184,8 +181,8 @@
 // Real (non-dummy) ADM implementations.
 #else
   AudioLayer audio_layer(PlatformAudioLayer());
-// Windows ADM implementation.
-#if defined(WEBRTC_WINDOWS_CORE_AUDIO_BUILD)
+#if defined(WEBRTC_WIN)
+  // Windows ADM implementation.
   if ((audio_layer == kWindowsCoreAudio) ||
       (audio_layer == kPlatformDefaultAudio)) {
     RTC_LOG(LS_INFO) << "Attempting to use the Windows Core Audio APIs...";
@@ -194,7 +191,7 @@
       RTC_LOG(LS_INFO) << "Windows Core Audio APIs will be utilized";
     }
   }
-#endif  // defined(WEBRTC_WINDOWS_CORE_AUDIO_BUILD)
+#endif
 
 // Linux ADM implementation.
 // Note that, WEBRTC_ENABLE_LINUX_ALSA is always defined by default when
diff --git a/modules/audio_device/mac/audio_device_mac.cc b/modules/audio_device/mac/audio_device_mac.cc
index d077a8b..1ff98af 100644
--- a/modules/audio_device/mac/audio_device_mac.cc
+++ b/modules/audio_device/mac/audio_device_mac.cc
@@ -17,7 +17,6 @@
 #include <memory>
 #include <vector>
 
-#include "modules/audio_device/audio_device_config.h"
 #include "modules/third_party/portaudio/pa_ringbuffer.h"
 #include "rtc_base/checks.h"
 #include "rtc_base/platform_thread.h"
diff --git a/modules/audio_device/win/audio_device_core_win.cc b/modules/audio_device/win/audio_device_core_win.cc
index f4321d1..fee7642 100644
--- a/modules/audio_device/win/audio_device_core_win.cc
+++ b/modules/audio_device/win/audio_device_core_win.cc
@@ -10,19 +10,6 @@
 
 #pragma warning(disable : 4995)  // name was marked as #pragma deprecated
 
-#if (_MSC_VER >= 1310) && (_MSC_VER < 1400)
-// Reports the major and minor versions of the compiler.
-// For example, 1310 for Microsoft Visual C++ .NET 2003. 1310 represents version
-// 13 and a 1.0 point release. The Visual C++ 2005 compiler version is 1400.
-// Type cl /? at the command line to see the major and minor versions of your
-// compiler along with the build number.
-#pragma message(">> INFO: Windows Core Audio is not supported in VS 2003")
-#endif
-
-#include "modules/audio_device/audio_device_config.h"  // IWYU pragma: keep
-
-#ifdef WEBRTC_WINDOWS_CORE_AUDIO_BUILD
-
 // clang-format off
 // To get Windows includes in the right order, this must come before the Windows
 // includes below.
@@ -4166,6 +4153,5 @@
   }
   return (key_down > 0);
 }
-}  // namespace webrtc
 
-#endif  // WEBRTC_WINDOWS_CORE_AUDIO_BUILD
+}  // namespace webrtc
diff --git a/modules/audio_device/win/audio_device_core_win.h b/modules/audio_device/win/audio_device_core_win.h
index c00bee5..578a1f6 100644
--- a/modules/audio_device/win/audio_device_core_win.h
+++ b/modules/audio_device/win/audio_device_core_win.h
@@ -11,8 +11,6 @@
 #ifndef MODULES_AUDIO_DEVICE_WIN_AUDIO_DEVICE_CORE_WIN_H_
 #define MODULES_AUDIO_DEVICE_WIN_AUDIO_DEVICE_CORE_WIN_H_
 
-#if (_MSC_VER >= 1400)  // only include for VS 2005 and higher
-
 #include <wmcodecdsp.h>  // CLSID_CWMAudioAEC
 //(must be before audioclient.h)
 
@@ -292,8 +290,6 @@
   uint16_t _outputDeviceIndex;
 };
 
-#endif  // #if (_MSC_VER >= 1400)
-
 }  // namespace webrtc
 
 #endif  // MODULES_AUDIO_DEVICE_WIN_AUDIO_DEVICE_CORE_WIN_H_
diff --git a/rtc_base/cpu_info.cc b/rtc_base/cpu_info.cc
index 22f7641..32e2eb3 100644
--- a/rtc_base/cpu_info.cc
+++ b/rtc_base/cpu_info.cc
@@ -10,7 +10,15 @@
 
 #include "rtc_base/cpu_info.h"
 
+#include <cerrno>
 #include <cstdint>
+#include <cstdlib>
+#include <cstring>
+
+#include "rtc_base/checks.h"
+#include "rtc_base/logging.h"
+#include "rtc_base/system/arch.h"
+#include "rtc_base/system/unused.h"  // IWYU pragma: keep
 
 #if defined(WEBRTC_WIN)
 #include <windows.h>
@@ -22,37 +30,15 @@
 #elif defined(WEBRTC_FUCHSIA)
 #include <zircon/syscalls.h>
 #elif defined(WEBRTC_LINUX)
-#include <features.h>
 #include <unistd.h>
-
-#include <cstdlib>
-#include <cstring>  // IWYU pragma: keep
-
-#ifdef __GLIBC_PREREQ
-#define WEBRTC_GLIBC_PREREQ(a, b) __GLIBC_PREREQ(a, b)
-#else
-#define WEBRTC_GLIBC_PREREQ(a, b) 0
-#endif
-
-#if WEBRTC_GLIBC_PREREQ(2, 16)
-#include <sys/auxv.h>  // IWYU pragma: keep
-#else
-#include <errno.h>
-#include <fcntl.h>
-#include <link.h>
-#endif
 #endif  // WEBRTC_LINUX
 
-#include "rtc_base/checks.h"
-#include "rtc_base/logging.h"
-#include "rtc_base/system/arch.h"
-#include "rtc_base/system/unused.h"  // IWYU pragma: keep
-
 #if defined(WEBRTC_ARCH_X86_FAMILY) && defined(_MSC_VER)
 #include <intrin.h>
 #endif
 #if defined(WEBRTC_ARCH_ARM_FAMILY) && defined(WEBRTC_LINUX)
 #include <asm/hwcap.h>
+#include <sys/auxv.h>
 #endif
 
 // Parts of this file derived from Chromium's base/cpu.cc.
@@ -192,26 +178,7 @@
     return 0 != (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON);
 #elif defined(WEBRTC_LINUX)
     uint64_t hwcap = 0;
-#if WEBRTC_GLIBC_PREREQ(2, 16)
     hwcap = getauxval(AT_HWCAP);
-#else
-    ElfW(auxv_t) auxv;
-    int fd = open("/proc/self/auxv", O_RDONLY);
-    if (fd >= 0) {
-      while (hwcap == 0) {
-        if (read(fd, &auxv, sizeof(auxv)) < (ssize_t)sizeof(auxv)) {
-          if (errno == EINTR) {
-            continue;
-          }
-          break;
-        }
-        if (AT_HWCAP == auxv.a_type) {
-          hwcap = auxv.a_un.a_val;
-        }
-      }
-      close(fd);
-    }
-#endif  // WEBRTC_GLIBC_PREREQ(2, 16)
 #if defined(__aarch64__)
     if ((hwcap & HWCAP_ASIMD) != 0) {
       return true;
diff --git a/rtc_base/logging.cc b/rtc_base/logging.cc
index eee7f21..f157205 100644
--- a/rtc_base/logging.cc
+++ b/rtc_base/logging.cc
@@ -10,37 +10,15 @@
 
 #include "rtc_base/logging.h"
 
-#include <atomic>
-#include <cstdint>
-#include <cstring>
-#include <string>
-
-#if RTC_LOG_ENABLED()
-
-#if defined(WEBRTC_WIN)
-#include <windows.h>
-#if _MSC_VER < 1900
-#define snprintf _snprintf
-#endif
-#undef ERROR  // wingdi.h
-#endif
-
-#if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS)
-#include <CoreServices/CoreServices.h>
-#elif defined(WEBRTC_ANDROID)
-#include <android/log.h>
-
-// Android has a 1024 limit on log inputs. We use 60 chars as an
-// approx for the header/tag portion.
-// See android/system/core/liblog/logd_write.c
-static const int kMaxLogLineSize = 1024 - 60;
-#endif  // WEBRTC_MAC && !defined(WEBRTC_IOS) || WEBRTC_ANDROID
-
 #include <algorithm>
+#include <atomic>
 #include <cinttypes>
 #include <cstdarg>
+#include <cstdint>
 #include <cstdio>
+#include <cstring>
 #include <ctime>
+#include <string>
 #include <vector>
 
 #include "absl/base/attributes.h"
@@ -55,6 +33,24 @@
 #include "rtc_base/thread_annotations.h"
 #include "rtc_base/time_utils.h"
 
+#if RTC_LOG_ENABLED()
+
+#if defined(WEBRTC_WIN)
+#include <windows.h>
+#undef ERROR  // wingdi.h
+#endif
+
+#if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS)
+#include <CoreServices/CoreServices.h>
+#elif defined(WEBRTC_ANDROID)
+#include <android/log.h>
+
+// Android has a 1024 limit on log inputs. We use 60 chars as an
+// approx for the header/tag portion.
+// See android/system/core/liblog/logd_write.c
+static const int kMaxLogLineSize = 1024 - 60;
+#endif  // WEBRTC_MAC && !defined(WEBRTC_IOS) || WEBRTC_ANDROID
+
 namespace webrtc {
 namespace {
 
diff --git a/sdk/BUILD.gn b/sdk/BUILD.gn
index 878aeb2..06d085e 100644
--- a/sdk/BUILD.gn
+++ b/sdk/BUILD.gn
@@ -335,7 +335,6 @@
           "../api/task_queue",
           "../api/task_queue:pending_task_safety_flag",
           "../modules/audio_device:audio_device_buffer",
-          "../modules/audio_device:audio_device_config",
           "../modules/audio_device:audio_device_generic",
           "../rtc_base:buffer",
           "../rtc_base:checks",
diff --git a/sdk/objc/native/src/audio/audio_device_module_ios.mm b/sdk/objc/native/src/audio/audio_device_module_ios.mm
index 7420d05..88f2077 100644
--- a/sdk/objc/native/src/audio/audio_device_module_ios.mm
+++ b/sdk/objc/native/src/audio/audio_device_module_ios.mm
@@ -13,7 +13,6 @@
 #include <memory>
 
 #include "api/environment/environment.h"
-#include "modules/audio_device/audio_device_config.h"
 #include "modules/audio_device/audio_device_generic.h"
 #include "rtc_base/checks.h"
 #include "rtc_base/logging.h"