浏览代码

Disable SEH for mingw-w64

The SEH implementation is not quite working properly in mingw-w64, so
disable it for the time being.
martell 10 年之前
父节点
当前提交
a83e74dc1c
共有 2 个文件被更改,包括 10 次插入1 次删除
  1. 4 0
      libobs/util/threading-windows.c
  2. 6 1
      plugins/win-capture/graphics-hook/d3d9-patches.hpp

+ 4 - 0
libobs/util/threading-windows.c

@@ -192,6 +192,9 @@ struct vs_threadname_info {
 
 void os_set_thread_name(const char *name)
 {
+#ifdef __MINGW32__
+	UNUSED_PARAMETER(name);
+#else
 	struct vs_threadname_info info;
 	info.type = 0x1000;
 	info.name = name;
@@ -211,4 +214,5 @@ void os_set_thread_name(const char *name)
 	} __except(EXCEPTION_EXECUTE_HANDLER) {
 #endif
 	}
+#endif
 }

+ 6 - 1
plugins/win-capture/graphics-hook/d3d9-patches.hpp

@@ -20,14 +20,19 @@
 static inline int safe_memcmp(const void *p1, const void *p2, size_t size)
 {
 
+// Disabled exceptions on mingw-w64 as it is broken
+#ifndef __MINGW32__
 #ifdef NO_SEH_MINGW
 	__try1(EXCEPTION_EXECUTE_HANDLER)
 #else
 	__try
+#endif
 #endif
 	{
 		return memcmp(p1, p2, size);
 	}
+// Disabled exceptions on mingw-w64 as it is broken
+#ifndef __MINGW32__
 #ifdef NO_SEH_MINGW
 	__except1
 #else
@@ -36,7 +41,7 @@ static inline int safe_memcmp(const void *p1, const void *p2, size_t size)
 	{
 		return -1;
 	}
-
+#endif
 }
 
 struct patch_info {