--- a/libaegisub/windows/util_win.cpp
+++ b/libaegisub/windows/util_win.cpp
@@ -49,6 +49,11 @@
 	DWORD dwFlags;    ///< reserved for future use, most be zero
 };
 
+#ifdef __MINGW32__
+#define __try if(true)
+#define __except(x) else
+#endif
+
 void SetThreadName(LPCSTR szThreadName) {
 	THREADNAME_INFO info;
 	info.dwType = 0x1000;
