From a24b45cc198dd027878c99314865510cca9cac34 Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Fri, 10 Jan 2025 15:07:56 -0500 Subject: [PATCH] patches: Track some MinGW fixups --- patches/0001-Some-fixes-for-MinGW.patch | 51 +++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 patches/0001-Some-fixes-for-MinGW.patch diff --git a/patches/0001-Some-fixes-for-MinGW.patch b/patches/0001-Some-fixes-for-MinGW.patch new file mode 100644 index 0000000..d739f15 --- /dev/null +++ b/patches/0001-Some-fixes-for-MinGW.patch @@ -0,0 +1,51 @@ +From a9f97c9fdd490e35bd43d6463424eee5b44c4a7d Mon Sep 17 00:00:00 2001 +From: Arun Raghavan +Date: Fri, 18 Jun 2021 18:40:32 -0400 +Subject: [PATCH] Some fixes for MinGW + + * Rename Windows.h uses to windows.h + * Comment out structured exception handling usage + +Makes MinGW happier. Mostly the same as previous work by +Nicolas Dufresne , with the exception +that we now don't try to invoke RaiseException which would fail in MinGW +as it raises a Windows structured exception. +--- + webrtc/rtc_base/platform_thread_types.cc | 2 ++ + webrtc/rtc_base/system/file_wrapper.cc | 2 +- + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/webrtc/rtc_base/platform_thread_types.cc b/webrtc/rtc_base/platform_thread_types.cc +index e98e8ec..1a24881 100644 +--- a/webrtc/rtc_base/platform_thread_types.cc ++++ b/webrtc/rtc_base/platform_thread_types.cc +@@ -118,11 +118,13 @@ void SetCurrentThreadName(const char* name) { + + #pragma warning(push) + #pragma warning(disable : 6320 6322) ++#ifndef __MINGW32__ + __try { + ::RaiseException(0x406D1388, 0, sizeof(threadname_info) / sizeof(ULONG_PTR), + reinterpret_cast(&threadname_info)); + } __except (EXCEPTION_EXECUTE_HANDLER) { // NOLINT + } ++#endif + #pragma warning(pop) + #elif defined(WEBRTC_LINUX) || defined(WEBRTC_ANDROID) + prctl(PR_SET_NAME, reinterpret_cast(name)); // NOLINT +diff --git a/webrtc/rtc_base/system/file_wrapper.cc b/webrtc/rtc_base/system/file_wrapper.cc +index 12c27a5..3203bc6 100644 +--- a/webrtc/rtc_base/system/file_wrapper.cc ++++ b/webrtc/rtc_base/system/file_wrapper.cc +@@ -22,7 +22,7 @@ + #include "rtc_base/numerics/safe_conversions.h" + + #ifdef _WIN32 +-#include ++#include + #else + #endif + +-- +2.47.1 +