diff options
| author | Jason Madden <jamadden@gmail.com> | 2021-10-28 10:05:30 -0500 |
|---|---|---|
| committer | Jason Madden <jamadden@gmail.com> | 2021-10-28 10:05:30 -0500 |
| commit | 41552cc97f862240d83f7cd6bccf7a88b5900849 (patch) | |
| tree | a8b1f37b7ab3c56a1cc22d598d64342d4a66e0f2 /setup.py | |
| parent | 3e5e9b535428dc6670cd0d06c30539676a18df67 (diff) | |
| download | greenlet-41552cc97f862240d83f7cd6bccf7a88b5900849.tar.gz | |
The 32-bit windows error seems to have something to do with Microsoft's SEH.
Diffstat (limited to 'setup.py')
| -rwxr-xr-x | setup.py | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -1,5 +1,5 @@ #! /usr/bin/env python - +from __future__ import print_function import sys import os import glob @@ -48,9 +48,19 @@ elif sys.platform == 'win32': # around try blocks are less aggressive. # /EHsc is suggested, as /EHa isn't supposed to be linked to other things not built # with it. - print("Enabling /EHsc") - cpp_compile_args.append("/EHsc") - + # See https://docs.microsoft.com/en-us/cpp/build/reference/eh-exception-handling-model?view=msvc-160 + handler = "/EHsc" + if '64 bit' not in sys.version: + # Our 32-bit switch_x64_msvc.h file + # reads and writes to fs:[0] and [seh]; the writes to fs:[0] + # generate "warning C4733: + # Inline asm assigning to 'FS:0': handler not registered as safe handler" + # We might need to pass /SAFESEH:NO to the linker somehow, or register + # the slp_switch function with the .SAFESEH assembler directive. Here, + # we're trying to enable generic SEH handling for everything. + handler = "/EHa" + print("Exception handling with", handler) + cpp_compile_args.append(handler) def readfile(filename): with open(filename, 'r') as f: # pylint:disable=unspecified-encoding |
