Correct exception wrapper MSVC conditional
Summary: The layout of an exception_ptr is determined by the ABI, not the OS. MinGW (and Cygwin, depending on the build settings) define `_WIN32` and would therefore have `kIsWindows` be true, but they use the Itanium ABI instead of Microsoft's, so we shouldn't take the MSVC codepath for them. Unfortunately, there isn't a reliable preprocessor method to determine the ABI being used. `_MSC_VER` can be defined even when using the Itanium ABI (e.g. when using windows-itanium triples with clang), and `_MSC_VER` can be undefined even when using the Microsoft ABI (e.g. when building with `-fno-ms-extensions` with clang). To address this, introduce `kMicrosoftAbiVer`, which defaults to `_MSC_VER`, but can be overridden manually if necessary. This should do the right thing by default most of the time, while providing an escape hatch for when `_MSC_VER` would be incorrect to use directly. Reviewed By: yfeldblum Differential Revision: D7377853 fbshipit-source-id: dd868370e9a496b98dd26dec77c4a75c49147c3c
Showing
Please register or sign in to comment