[PATCH] D50564: Add support for SEH unwinding on Windows.

Martin Storsjö via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 14 10:27:43 PDT 2018


mstorsjo added a comment.

In https://reviews.llvm.org/D50564#1199285, @rnk wrote:

> In https://reviews.llvm.org/D50564#1198996, @cdavis5x wrote:
>
> > Could somebody verify that the `DISPATCHER_CONTEXT` struct is defined in `<winnt.h>` for the Win8 and Win10 SDKs? I can't install them right now.
>
>
> I checked both, and they are available, so I think we should guard the definition like this:
>
>   // Provide a definition for _DISPATCHER_CONTEXT for Win7 and earlier SDK versions.
>   // Mingw64 has always provided this struct.
>   #if defined(_LIBUNWIND_SUPPORT_SEH_UNWIND) && !defined(__MINGW64__) && defined(WINVER) && WINVER < _WIN32_WINNT_WIN8


For the mingw check, I'd prefer checking for `__MINGW32__`, as the -64 version isn't defined when targeting 32 bit ARM (which uses SEH, even though everything isn't in place for it in LLVM).

And mingw-w64 might lack this struct for arm/arm64, but I can fix that and wouldn't bother with older versions of that.

And if these structs only are added for compat with the win7 sdk, maybe omit the arm one altogether, as all modern non-windows ce versions on arm is >= win8.


Repository:
  rUNW libunwind

https://reviews.llvm.org/D50564





More information about the cfe-commits mailing list