Dep/g3d: Build fix for gcc on windows

(cherry picked from commit 2371cabb29fbd650b3e059a8c983f35fa5d54442)
This commit is contained in:
Shauren authored and Ovahlord committed 2026-06-07 21:20:27 +02:00
1 parent 0419cbd612
commit 6c9785127f
5 files changed
+109 -7

No files matched your search

+8 -3
View File
@@ -91,6 +91,11 @@ typedef struct tagTHREADNAME_INFO {
} THREADNAME_INFO;
#pragma pack(pop)
static LONG ExceptionIgnorer(PEXCEPTION_POINTERS ex)
{
return ex->ExceptionRecord->ExceptionCode == MS_VC_EXCEPTION ? EXCEPTION_CONTINUE_EXECUTION : EXCEPTION_CONTINUE_SEARCH;
}
static void SetThreadName(DWORD dwThreadID, const char* threadName) {
THREADNAME_INFO info;
info.dwType = 0x1000;
@@ -98,9 +103,9 @@ static void SetThreadName(DWORD dwThreadID, const char* threadName) {
info.dwThreadID = dwThreadID;
info.dwFlags = 0;
__try {
RaiseException( MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(ULONG_PTR), (ULONG_PTR*)&info );
} __except(EXCEPTION_EXECUTE_HANDLER) {}
PVOID handler = AddVectoredExceptionHandler(1, &ExceptionIgnorer);
RaiseException( MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(ULONG_PTR), (ULONG_PTR*)&info );
RemoveVectoredExceptionHandler(handler);
}
#endif