Commit 7d625d63 authored by Shoaib Meenai's avatar Shoaib Meenai Committed by Facebook Github Bot

Support 32-bit Windows in exception wrapper

Summary:
It's easy enough to calculate the right offset for both 32 and 64-bit
platforms, so we can just do so instead of hardcoding the 64-bit offset.

Reviewed By: yfeldblum, Orvid

Differential Revision: D7377039

fbshipit-source-id: 5f7efbae58b7694801274e195a97b5e5b62b5a5e
parent e37d52f2
......@@ -92,9 +92,6 @@ inline std::exception const* exception_wrapper::as_exception_or_null_(
return nullptr;
}
static_assert(
!kIsWindows || sizeof(void*) == 8,
"exception_wrapper is untested on 32 bit Windows.");
static_assert(
!kIsWindows || (kMscVer >= 1900 && kMscVer <= 2000),
"exception_wrapper is untested and possibly broken on your version of "
......@@ -120,7 +117,7 @@ inline std::uintptr_t exception_wrapper::ExceptionPtr::as_int_(
// We derive the offset to pExceptionObject via manual means.
FOLLY_PACK_PUSH
struct Win32ExceptionPtr {
char offset[40];
char offset[8 + 4 * sizeof(void*)];
void* exceptionObject;
} FOLLY_PACK_ATTR;
FOLLY_PACK_POP
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment