diff options
Diffstat (limited to 'Python/pyfpe.c')
-rw-r--r-- | Python/pyfpe.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/Python/pyfpe.c b/Python/pyfpe.c index 31ef5d7..4b7f5ba 100644 --- a/Python/pyfpe.c +++ b/Python/pyfpe.c @@ -1,15 +1,23 @@ -/* These variables used to be used when Python was built with --with-fpectl, - * but support for that was dropped in 3.7. We continue to define them, - * though, because they may be referenced by extensions using the stable ABI. +#include "pyconfig.h" +#include "pyfpe.h" +/* + * The signal handler for SIGFPE is actually declared in an external + * module fpectl, or as preferred by the user. These variable + * definitions are required in order to compile Python without + * getting missing externals, but to actually handle SIGFPE requires + * defining a handler and enabling generation of SIGFPE. */ -#include "setjmp.h" - +#ifdef WANT_SIGFPE_HANDLER jmp_buf PyFPE_jbuf; -int PyFPE_counter; +int PyFPE_counter = 0; +#endif + +/* Have this outside the above #ifdef, since some picky ANSI compilers issue a + warning when compiling an empty file. */ double PyFPE_dummy(void *dummy) { - return 1.0; + return 1.0; } |