libobs: threading-windows mingw-w64 support

Enable support for mingw-w64 in threading-windows.c
master
martell 2015-02-08 09:23:02 -08:00 committed by jp9000
parent 079d15d518
commit 23d39ea5a8
1 changed files with 23 additions and 0 deletions

View File

@ -20,6 +20,21 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#ifdef __MINGW32__
#include <excpt.h>
#ifndef TRYLEVEL_NONE
#ifndef __MINGW64__
#define NO_SEH_MINGW
#endif
#ifndef __try
#define __try
#endif
#ifndef __except
#define __except(x) if (0)
#endif
#endif
#endif
struct os_event_data {
HANDLE handle;
};
@ -183,9 +198,17 @@ void os_set_thread_name(const char *name)
info.thread_id = GetCurrentThreadId();
info.flags = 0;
#ifdef NO_SEH_MINGW
__try1(EXCEPTION_EXECUTE_HANDLER) {
#else
__try {
#endif
RaiseException(VC_EXCEPTION, 0, THREADNAME_INFO_SIZE,
(ULONG_PTR*)&info);
#ifdef NO_SEH_MINGW
} __except1 {
#else
} __except(EXCEPTION_EXECUTE_HANDLER) {
#endif
}
}