aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/python/src/Python/pyfpe.c
diff options
context:
space:
mode:
authornkozlovskiy <nmk@ydb.tech>2023-09-29 12:24:06 +0300
committernkozlovskiy <nmk@ydb.tech>2023-09-29 12:41:34 +0300
commite0e3e1717e3d33762ce61950504f9637a6e669ed (patch)
treebca3ff6939b10ed60c3d5c12439963a1146b9711 /contrib/tools/python/src/Python/pyfpe.c
parent38f2c5852db84c7b4d83adfcb009eb61541d1ccd (diff)
downloadydb-e0e3e1717e3d33762ce61950504f9637a6e669ed.tar.gz
add ydb deps
Diffstat (limited to 'contrib/tools/python/src/Python/pyfpe.c')
-rw-r--r--contrib/tools/python/src/Python/pyfpe.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/contrib/tools/python/src/Python/pyfpe.c b/contrib/tools/python/src/Python/pyfpe.c
new file mode 100644
index 0000000000..4b7f5bae15
--- /dev/null
+++ b/contrib/tools/python/src/Python/pyfpe.c
@@ -0,0 +1,23 @@
+#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.
+ */
+
+#ifdef WANT_SIGFPE_HANDLER
+jmp_buf PyFPE_jbuf;
+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;
+}