Add support for compiling under MinGW + fix Windows compiling in general

This commit is contained in:
wuggy 2026-04-17 15:05:11 -07:00
commit a5cf494890
56 changed files with 243 additions and 76 deletions

View file

@ -73,11 +73,17 @@ void SetCurrentThreadName(const char* name) {
DWORD dwFlags;
} threadname_info = {0x1000, name, static_cast<DWORD>(-1), 0};
#if defined(_MSC_VER)
__try {
::RaiseException(0x406D1388, 0, sizeof(threadname_info) / sizeof(DWORD),
reinterpret_cast<ULONG_PTR*>(&threadname_info));
} __except (EXCEPTION_EXECUTE_HANDLER) {
}
#else
// MinGW does not support MSVC's __try/__except syntax.
::RaiseException(0x406D1388, 0, sizeof(threadname_info) / sizeof(DWORD),
reinterpret_cast<ULONG_PTR*>(&threadname_info));
#endif
#elif defined(WEBRTC_LINUX) || defined(WEBRTC_ANDROID)
prctl(PR_SET_NAME, reinterpret_cast<unsigned long>(name));
#elif defined(WEBRTC_MAC) || defined(WEBRTC_IOS)

View file

@ -605,7 +605,7 @@ BOOL MyWinHttpGetProxyForUrl(pfnWinHttpGetProxyForUrl pWHGPFU,
// error.
BOOL success = FALSE;
#if (_HAS_EXCEPTIONS == 0)
#if (_HAS_EXCEPTIONS == 0) && defined(_MSC_VER)
__try {
success = pWHGPFU(hWinHttp, url, options, info);
} __except(EXCEPTION_EXECUTE_HANDLER) {

View file

@ -60,7 +60,7 @@ protected:
int32_t capabilityIndex);
int32_t DisconnectGraph();
HRESULT VideoCaptureDS::ConnectDVCamera();
HRESULT ConnectDVCamera();
DeviceInfoDS _dsInfo;
VideoCaptureCapability _activeCapability;

View file

@ -12,6 +12,8 @@
#include <assert.h>
#include <stdlib.h>
#ifdef WIN32
#include <direct.h>
#include <tchar.h>
@ -33,7 +35,6 @@
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "webrtc/typedefs.h" // For architecture defines