Index: libunwind/include/__libunwind_config.h =================================================================== --- libunwind/include/__libunwind_config.h +++ libunwind/include/__libunwind_config.h @@ -36,7 +36,7 @@ # define _LIBUNWIND_TARGET_X86_64 1 # if defined(_WIN64) # define _LIBUNWIND_CONTEXT_SIZE 54 -# ifdef __SEH__ +# if defined(__SEH__) || defined(_MSC_VER) # define _LIBUNWIND_CURSOR_SIZE 204 # else # define _LIBUNWIND_CURSOR_SIZE 66 @@ -59,7 +59,7 @@ # elif defined(__aarch64__) # define _LIBUNWIND_TARGET_AARCH64 1 # define _LIBUNWIND_CONTEXT_SIZE 66 -# if defined(__SEH__) +# if defined(__SEH__) || defined(_MSC_VER) # define _LIBUNWIND_CURSOR_SIZE 164 # else # define _LIBUNWIND_CURSOR_SIZE 78 @@ -67,7 +67,7 @@ # define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM64 # elif defined(__arm__) # define _LIBUNWIND_TARGET_ARM 1 -# if defined(__SEH__) +# if defined(__SEH__) || defined(_MSC_VER) # define _LIBUNWIND_CONTEXT_SIZE 42 # define _LIBUNWIND_CURSOR_SIZE 80 # elif defined(__ARM_WMMX) Index: libunwind/include/libunwind.h =================================================================== --- libunwind/include/libunwind.h +++ libunwind/include/libunwind.h @@ -43,7 +43,7 @@ #define LIBUNWIND_AVAIL #endif -#if defined(_WIN32) && defined(__SEH__) +#if defined(_WIN32) && (defined(__SEH__) || defined(_MSC_VER)) #define LIBUNWIND_CURSOR_ALIGNMENT_ATTR __attribute__((__aligned__(16))) #else #define LIBUNWIND_CURSOR_ALIGNMENT_ATTR Index: libunwind/include/unwind.h =================================================================== --- libunwind/include/unwind.h +++ libunwind/include/unwind.h @@ -18,7 +18,7 @@ #include #include -#if defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__) && defined(_WIN32) +#if (defined(__SEH__) || defined(_MSC_VER)) && !defined(__USING_SJLJ_EXCEPTIONS__) && defined(_WIN32) #include #include #endif @@ -123,7 +123,7 @@ uint64_t exception_class; void (*exception_cleanup)(_Unwind_Reason_Code reason, _Unwind_Exception *exc); -#if defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__) +#if (defined(__SEH__) || defined(_MSC_VER)) && !defined(__USING_SJLJ_EXCEPTIONS__) uintptr_t private_[6]; #else uintptr_t private_1; // non-zero means forced unwind @@ -373,7 +373,7 @@ extern void *__deregister_frame_info_bases(const void *fde) LIBUNWIND_UNAVAIL; -#if defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__) +#if (defined(__SEH__) || defined(_MSC_VER)) && !defined(__USING_SJLJ_EXCEPTIONS__) #ifndef _WIN32 typedef struct _EXCEPTION_RECORD EXCEPTION_RECORD; typedef struct _CONTEXT CONTEXT; Index: libunwind/src/Unwind-seh.cpp =================================================================== --- libunwind/src/Unwind-seh.cpp +++ libunwind/src/Unwind-seh.cpp @@ -149,7 +149,7 @@ // If we were called by __libunwind_seh_personality(), indicate that // a handler was found; otherwise, initiate phase 2 by unwinding. if (ours && ms_exc->NumberParameters > 1) - return 4 /* ExecptionExecuteHandler in mingw */; + return (EXCEPTION_DISPOSITION) 4 /* ExecptionExecuteHandler in mingw */; // This should never happen in phase 2. if (IS_UNWINDING(ms_exc->ExceptionFlags)) _LIBUNWIND_ABORT("Personality indicated exception handler in phase 2!"); @@ -167,7 +167,7 @@ // a handler was found; otherwise, it's time to initiate a collided // unwind to the target. if (ours && !IS_UNWINDING(ms_exc->ExceptionFlags) && ms_exc->NumberParameters > 1) - return 4 /* ExecptionExecuteHandler in mingw */; + return (EXCEPTION_DISPOSITION) 4 /* ExecptionExecuteHandler in mingw */; // This should never happen in phase 1. if (!IS_UNWINDING(ms_exc->ExceptionFlags)) _LIBUNWIND_ABORT("Personality installed context during phase 1!"); Index: libunwind/src/config.h =================================================================== --- libunwind/src/config.h +++ libunwind/src/config.h @@ -27,7 +27,7 @@ #define _LIBUNWIND_SUPPORT_DWARF_UNWIND 1 #endif #elif defined(_WIN32) - #ifdef __SEH__ + #if defined(__SEH__) || defined(_MSC_VER) #define _LIBUNWIND_SUPPORT_SEH_UNWIND 1 #else #define _LIBUNWIND_SUPPORT_DWARF_UNWIND 1