annotate Modules/fpectlmodule.c @ 16798:258dcafe2d0b legacy-trunk

Gustavo Niemeyer <niemeyer@conectiva.com>: Fixed recno support (keys are integers rather than strings). Work around DB bug that cause stdin to be closed by rnopen() when the DB file needed to exist but did not (no longer segfaults). This closes SF tracker patch #403445. Also wrapped some long lines and added whitespace around operators -- FLD.
author Fred Drake <fdrake@acm.org>
date Tue, 27 Feb 2001 18:56:46 +0000
parents 3693abd0eac1
children 99de4bf2b9e5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5120
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
1 /*
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
2 ---------------------------------------------------------------------
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3 / Copyright (c) 1996. \
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
4 | The Regents of the University of California. |
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
5 | All rights reserved. |
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
6 | |
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
7 | Permission to use, copy, modify, and distribute this software for |
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
8 | any purpose without fee is hereby granted, provided that this en- |
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
9 | tire notice is included in all copies of any software which is or |
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
10 | includes a copy or modification of this software and in all |
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
11 | copies of the supporting documentation for such software. |
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
12 | |
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
13 | This work was produced at the University of California, Lawrence |
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
14 | Livermore National Laboratory under contract no. W-7405-ENG-48 |
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
15 | between the U.S. Department of Energy and The Regents of the |
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
16 | University of California for the operation of UC LLNL. |
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
17 | |
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
18 | DISCLAIMER |
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
19 | |
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
20 | This software was prepared as an account of work sponsored by an |
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
21 | agency of the United States Government. Neither the United States |
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
22 | Government nor the University of California nor any of their em- |
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
23 | ployees, makes any warranty, express or implied, or assumes any |
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
24 | liability or responsibility for the accuracy, completeness, or |
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
25 | usefulness of any information, apparatus, product, or process |
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
26 | disclosed, or represents that its use would not infringe |
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
27 | privately-owned rights. Reference herein to any specific commer- |
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
28 | cial products, process, or service by trade name, trademark, |
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
29 | manufacturer, or otherwise, does not necessarily constitute or |
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
30 | imply its endorsement, recommendation, or favoring by the United |
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
31 | States Government or the University of California. The views and |
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
32 | opinions of authors expressed herein do not necessarily state or |
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
33 | reflect those of the United States Government or the University |
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
34 | of California, and shall not be used for advertising or product |
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
35 \ endorsement purposes. /
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
36 ---------------------------------------------------------------------
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
37 */
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
38
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
39 /*
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
40 Floating point exception control module.
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
41
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
42 This Python module provides bare-bones control over floating point
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
43 units from several hardware manufacturers. Specifically, it allows
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
44 the user to turn on the generation of SIGFPE whenever any of the
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
45 three serious IEEE 754 exceptions (Division by Zero, Overflow,
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
46 Invalid Operation) occurs. We currently ignore Underflow and
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
47 Inexact Result exceptions, although those could certainly be added
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
48 if desired.
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
49
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
50 The module also establishes a signal handler for SIGFPE during
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
51 initialization. This builds on code found in the Python
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
52 distribution at Include/pyfpe.h and Python/pyfpe.c. If those files
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
53 are not in your Python distribution, find them in a patch at
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
54 ftp://icf.llnl.gov/pub/python/busby/patches.961108.tgz.
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
55
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
56 This module is only useful to you if it happens to include code
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
57 specific for your hardware and software environment. If you can
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
58 contribute OS-specific code for new platforms, or corrections for
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
59 the code provided, it will be greatly appreciated.
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
60
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
61 ** Version 1.0: September 20, 1996. Lee Busby, LLNL.
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
62 */
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
63
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
64 #ifdef __cplusplus
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
65 extern "C" {
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
66 #endif
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
67
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
68 #include "Python.h"
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
69 #include <signal.h>
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
70
14683
edf1e15c671a Randall Hopper: Add fpectl functionality patch for FreeBSD.
Guido van Rossum <guido@python.org>
parents: 13676
diff changeset
71 #if defined(__FreeBSD__)
edf1e15c671a Randall Hopper: Add fpectl functionality patch for FreeBSD.
Guido van Rossum <guido@python.org>
parents: 13676
diff changeset
72 # include <ieeefp.h>
edf1e15c671a Randall Hopper: Add fpectl functionality patch for FreeBSD.
Guido van Rossum <guido@python.org>
parents: 13676
diff changeset
73 #endif
edf1e15c671a Randall Hopper: Add fpectl functionality patch for FreeBSD.
Guido van Rossum <guido@python.org>
parents: 13676
diff changeset
74
5120
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
75 #ifndef WANT_SIGFPE_HANDLER
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
76 /* Define locally if they are not defined in Python. This gives only
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
77 * the limited control to induce a core dump in case of an exception.
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
78 */
5196
8ee81ef4e982 Include setjmp.h so it compiles if WANT_SIGFPE_HANDLER is undefined.
Guido van Rossum <guido@python.org>
parents: 5120
diff changeset
79 #include <setjmp.h>
5120
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
80 static jmp_buf PyFPE_jbuf;
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
81 static int PyFPE_counter = 0;
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
82 #endif
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
83
13676
5423b132bc97 Removed all instances of RETSIGTYPE from the source code: signal
Tim Peters <tim.peters@gmail.com>
parents: 10617
diff changeset
84 typedef void Sigfunc(int);
5120
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
85 static Sigfunc sigfpe_handler;
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
86 static void fpe_reset(Sigfunc *);
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
87
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
88 static PyObject *fpe_error;
9620
179fb63b1554 Needed to add DL_EXPORT to (redundant?) extern decl of module init function.
Guido van Rossum <guido@python.org>
parents: 9588
diff changeset
89 DL_EXPORT(void) initfpectl(void);
5120
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
90 static PyObject *turnon_sigfpe (PyObject *self,PyObject *args);
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
91 static PyObject *turnoff_sigfpe (PyObject *self,PyObject *args);
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
92
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
93 static PyMethodDef fpectl_methods[] = {
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
94 {"turnon_sigfpe", (PyCFunction) turnon_sigfpe, 1},
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
95 {"turnoff_sigfpe", (PyCFunction) turnoff_sigfpe, 1},
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
96 {0,0}
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
97 };
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
98
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
99 static PyObject *turnon_sigfpe(PyObject *self,PyObject *args)
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
100 {
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
101 /* Do any architecture-specific one-time only initialization here. */
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
102
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
103 fpe_reset(sigfpe_handler);
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
104 Py_INCREF (Py_None);
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
105 return Py_None;
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
106 }
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
107
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
108 static void fpe_reset(Sigfunc *handler)
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
109 {
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
110 /* Reset the exception handling machinery, and reset the signal
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
111 * handler for SIGFPE to the given handler.
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
112 */
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
113
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
114 /*-- IRIX -----------------------------------------------------------------*/
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
115 #if defined(sgi)
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
116 /* See man page on handle_sigfpes -- must link with -lfpe
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
117 * My usage doesn't follow the man page exactly. Maybe somebody
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
118 * else can explain handle_sigfpes to me....
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
119 * cc -c -I/usr/local/python/include fpectlmodule.c
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
120 * ld -shared -o fpectlmodule.so fpectlmodule.o -lfpe
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
121 */
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
122 #include <sigfpe.h>
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
123 typedef void user_routine (unsigned[5], int[2]);
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
124 typedef void abort_routine (unsigned long);
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
125 handle_sigfpes(_OFF, 0,
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
126 (user_routine *)0,
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
127 _TURN_OFF_HANDLER_ON_ERROR,
5380
2d4c6cba01bf Keep gcc -Wall happy.
Guido van Rossum <guido@python.org>
parents: 5196
diff changeset
128 NULL);
5120
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
129 handle_sigfpes(_ON, _EN_OVERFL | _EN_DIVZERO | _EN_INVALID,
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
130 (user_routine *)0,
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
131 _ABORT_ON_ERROR,
5380
2d4c6cba01bf Keep gcc -Wall happy.
Guido van Rossum <guido@python.org>
parents: 5196
diff changeset
132 NULL);
14719
870237089ba2 Use PyOS_setsig() instead of signal(). Also remove redundant spaces
Guido van Rossum <guido@python.org>
parents: 14683
diff changeset
133 PyOS_setsig(SIGFPE, handler);
5120
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
134
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
135 /*-- SunOS and Solaris ----------------------------------------------------*/
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
136 #elif defined(sun)
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
137 /* References: ieee_handler, ieee_sun, ieee_functions, and ieee_flags
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
138 man pages (SunOS or Solaris)
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
139 cc -c -I/usr/local/python/include fpectlmodule.c
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
140 ld -G -o fpectlmodule.so -L/opt/SUNWspro/lib fpectlmodule.o -lsunmath -lm
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
141 */
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
142 #include <math.h>
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
143 char *mode="exception", *in="all", *out;
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
144 (void) nonstandard_arithmetic();
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
145 (void) ieee_flags("clearall",mode,in,&out);
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
146 (void) ieee_handler("set","common",(sigfpe_handler_type)handler);
14719
870237089ba2 Use PyOS_setsig() instead of signal(). Also remove redundant spaces
Guido van Rossum <guido@python.org>
parents: 14683
diff changeset
147 PyOS_setsig(SIGFPE, handler);
5120
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
148
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
149 /*-- HPUX -----------------------------------------------------------------*/
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
150 #elif defined(__hppa) || defined(hppa)
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
151 /* References: fpsetmask man page */
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
152 /* cc -Aa +z -c -I/usr/local/python/include fpectlmodule.c */
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
153 /* ld -b -o fpectlmodule.sl fpectlmodule.o -lm */
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
154 #include <math.h>
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
155 fpsetdefaults();
14719
870237089ba2 Use PyOS_setsig() instead of signal(). Also remove redundant spaces
Guido van Rossum <guido@python.org>
parents: 14683
diff changeset
156 PyOS_setsig(SIGFPE, handler);
5120
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
157
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
158 /*-- IBM AIX --------------------------------------------------------------*/
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
159 #elif defined(__AIX) || defined(_AIX)
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
160 /* References: fp_trap, fp_enable man pages */
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
161 #include <fptrap.h>
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
162 fp_trap(FP_TRAP_SYNC);
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
163 fp_enable(TRP_INVALID | TRP_DIV_BY_ZERO | TRP_OVERFLOW);
14719
870237089ba2 Use PyOS_setsig() instead of signal(). Also remove redundant spaces
Guido van Rossum <guido@python.org>
parents: 14683
diff changeset
164 PyOS_setsig(SIGFPE, handler);
5120
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
165
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
166 /*-- DEC ALPHA OSF --------------------------------------------------------*/
10617
012d361fdf23 Avoid triggering Alpha OSF/1 specific code on Alpha NT or Linux.
Guido van Rossum <guido@python.org>
parents: 9620
diff changeset
167 #elif defined(__alpha) && defined(__osf__)
5120
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
168 /* References: exception_intro, ieee man pages */
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
169 /* cc -c -I/usr/local/python/include fpectlmodule.c */
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
170 /* ld -shared -o fpectlmodule.so fpectlmodule.o */
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
171 #include <machine/fpu.h>
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
172 unsigned long fp_control =
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
173 IEEE_TRAP_ENABLE_INV | IEEE_TRAP_ENABLE_DZE | IEEE_TRAP_ENABLE_OVF;
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
174 ieee_set_fp_control(fp_control);
14719
870237089ba2 Use PyOS_setsig() instead of signal(). Also remove redundant spaces
Guido van Rossum <guido@python.org>
parents: 14683
diff changeset
175 PyOS_setsig(SIGFPE, handler);
5120
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
176
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
177 /*-- Cray Unicos ----------------------------------------------------------*/
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
178 #elif defined(cray)
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
179 /* UNICOS delivers SIGFPE by default, but no matherr */
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
180 #ifdef HAS_LIBMSET
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
181 libmset(-1);
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
182 #endif
14719
870237089ba2 Use PyOS_setsig() instead of signal(). Also remove redundant spaces
Guido van Rossum <guido@python.org>
parents: 14683
diff changeset
183 PyOS_setsig(SIGFPE, handler);
5120
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
184
14683
edf1e15c671a Randall Hopper: Add fpectl functionality patch for FreeBSD.
Guido van Rossum <guido@python.org>
parents: 13676
diff changeset
185 /*-- FreeBSD ----------------------------------------------------------------*/
edf1e15c671a Randall Hopper: Add fpectl functionality patch for FreeBSD.
Guido van Rossum <guido@python.org>
parents: 13676
diff changeset
186 #elif defined(__FreeBSD__)
14719
870237089ba2 Use PyOS_setsig() instead of signal(). Also remove redundant spaces
Guido van Rossum <guido@python.org>
parents: 14683
diff changeset
187 fpresetsticky(fpgetsticky());
870237089ba2 Use PyOS_setsig() instead of signal(). Also remove redundant spaces
Guido van Rossum <guido@python.org>
parents: 14683
diff changeset
188 fpsetmask(FP_X_INV | FP_X_DZ | FP_X_OFL);
870237089ba2 Use PyOS_setsig() instead of signal(). Also remove redundant spaces
Guido van Rossum <guido@python.org>
parents: 14683
diff changeset
189 PyOS_setsig(SIGFPE, handler);
14683
edf1e15c671a Randall Hopper: Add fpectl functionality patch for FreeBSD.
Guido van Rossum <guido@python.org>
parents: 13676
diff changeset
190
5120
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
191 /*-- Linux ----------------------------------------------------------------*/
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
192 #elif defined(linux)
6855
1ab307951f4e Patch by Oliver Andrich for Lunix using glibc.
Guido van Rossum <guido@python.org>
parents: 6507
diff changeset
193 #ifdef __GLIBC__
1ab307951f4e Patch by Oliver Andrich for Lunix using glibc.
Guido van Rossum <guido@python.org>
parents: 6507
diff changeset
194 #include <fpu_control.h>
1ab307951f4e Patch by Oliver Andrich for Lunix using glibc.
Guido van Rossum <guido@python.org>
parents: 6507
diff changeset
195 #else
6507
a00073f2e087 Some patches to Lee Busby's fpectl mods that accidentally didn't make it
Guido van Rossum <guido@python.org>
parents: 6367
diff changeset
196 #include <i386/fpu_control.h>
6855
1ab307951f4e Patch by Oliver Andrich for Lunix using glibc.
Guido van Rossum <guido@python.org>
parents: 6507
diff changeset
197 #endif
15713
3693abd0eac1 Patch #103012: Update fpectlmodule for current glibc;
Andrew M. Kuchling <amk@amk.ca>
parents: 14719
diff changeset
198 #ifdef _FPU_SETCW
3693abd0eac1 Patch #103012: Update fpectlmodule for current glibc;
Andrew M. Kuchling <amk@amk.ca>
parents: 14719
diff changeset
199 {
3693abd0eac1 Patch #103012: Update fpectlmodule for current glibc;
Andrew M. Kuchling <amk@amk.ca>
parents: 14719
diff changeset
200 fpu_control_t cw = 0x1372;
3693abd0eac1 Patch #103012: Update fpectlmodule for current glibc;
Andrew M. Kuchling <amk@amk.ca>
parents: 14719
diff changeset
201 _FPU_SETCW(cw);
3693abd0eac1 Patch #103012: Update fpectlmodule for current glibc;
Andrew M. Kuchling <amk@amk.ca>
parents: 14719
diff changeset
202 }
3693abd0eac1 Patch #103012: Update fpectlmodule for current glibc;
Andrew M. Kuchling <amk@amk.ca>
parents: 14719
diff changeset
203 #else
6507
a00073f2e087 Some patches to Lee Busby's fpectl mods that accidentally didn't make it
Guido van Rossum <guido@python.org>
parents: 6367
diff changeset
204 __setfpucw(0x1372);
15713
3693abd0eac1 Patch #103012: Update fpectlmodule for current glibc;
Andrew M. Kuchling <amk@amk.ca>
parents: 14719
diff changeset
205 #endif
14719
870237089ba2 Use PyOS_setsig() instead of signal(). Also remove redundant spaces
Guido van Rossum <guido@python.org>
parents: 14683
diff changeset
206 PyOS_setsig(SIGFPE, handler);
5120
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
207
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
208 /*-- NeXT -----------------------------------------------------------------*/
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
209 #elif defined(NeXT) && defined(m68k) && defined(__GNUC__)
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
210 /* NeXT needs explicit csr set to generate SIGFPE */
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
211 asm("fmovel #0x1400,fpcr"); /* set OVFL and ZD bits */
14719
870237089ba2 Use PyOS_setsig() instead of signal(). Also remove redundant spaces
Guido van Rossum <guido@python.org>
parents: 14683
diff changeset
212 PyOS_setsig(SIGFPE, handler);
5120
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
213
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
214 /*-- Microsoft Windows, NT ------------------------------------------------*/
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
215 #elif defined(_MSC_VER)
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
216 /* Reference: Visual C++ Books Online 4.2,
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
217 Run-Time Library Reference, _control87, _controlfp */
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
218 #include <float.h>
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
219 unsigned int cw = _EM_INVALID | _EM_ZERODIVIDE | _EM_OVERFLOW;
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
220 (void)_controlfp(0, cw);
14719
870237089ba2 Use PyOS_setsig() instead of signal(). Also remove redundant spaces
Guido van Rossum <guido@python.org>
parents: 14683
diff changeset
221 PyOS_setsig(SIGFPE, handler);
5120
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
222
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
223 /*-- Give Up --------------------------------------------------------------*/
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
224 #else
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
225 fputs("Operation not implemented\n", stderr);
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
226 #endif
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
227
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
228 }
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
229
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
230 static PyObject *turnoff_sigfpe(PyObject *self,PyObject *args)
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
231 {
14683
edf1e15c671a Randall Hopper: Add fpectl functionality patch for FreeBSD.
Guido van Rossum <guido@python.org>
parents: 13676
diff changeset
232 #ifdef __FreeBSD__
14719
870237089ba2 Use PyOS_setsig() instead of signal(). Also remove redundant spaces
Guido van Rossum <guido@python.org>
parents: 14683
diff changeset
233 fpresetsticky(fpgetsticky());
870237089ba2 Use PyOS_setsig() instead of signal(). Also remove redundant spaces
Guido van Rossum <guido@python.org>
parents: 14683
diff changeset
234 fpsetmask(0);
14683
edf1e15c671a Randall Hopper: Add fpectl functionality patch for FreeBSD.
Guido van Rossum <guido@python.org>
parents: 13676
diff changeset
235 #else
5120
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
236 fputs("Operation not implemented\n", stderr);
14683
edf1e15c671a Randall Hopper: Add fpectl functionality patch for FreeBSD.
Guido van Rossum <guido@python.org>
parents: 13676
diff changeset
237 #endif
14719
870237089ba2 Use PyOS_setsig() instead of signal(). Also remove redundant spaces
Guido van Rossum <guido@python.org>
parents: 14683
diff changeset
238 Py_INCREF(Py_None);
5120
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
239 return Py_None;
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
240 }
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
241
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
242 static void sigfpe_handler(int signo)
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
243 {
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
244 fpe_reset(sigfpe_handler);
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
245 if(PyFPE_counter) {
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
246 longjmp(PyFPE_jbuf, 1);
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
247 } else {
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
248 Py_FatalError("Unprotected floating point exception");
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
249 }
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
250 }
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
251
9588
38023a425e48 Add DL_EXPORT() to all modules that could possibly be used
Guido van Rossum <guido@python.org>
parents: 6855
diff changeset
252 DL_EXPORT(void) initfpectl(void)
5120
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
253 {
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
254 PyObject *m, *d;
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
255 m = Py_InitModule("fpectl", fpectl_methods);
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
256 d = PyModule_GetDict(m);
6367
2c29b8982643 Apply two changes, systematically:
Guido van Rossum <guido@python.org>
parents: 5380
diff changeset
257 fpe_error = PyErr_NewException("fpectl.error", NULL, NULL);
2c29b8982643 Apply two changes, systematically:
Guido van Rossum <guido@python.org>
parents: 5380
diff changeset
258 if (fpe_error != NULL)
2c29b8982643 Apply two changes, systematically:
Guido van Rossum <guido@python.org>
parents: 5380
diff changeset
259 PyDict_SetItemString(d, "error", fpe_error);
5120
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
260 }
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
261
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
262 #ifdef __cplusplus
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
263 }
a48f3678f9e1 Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff changeset
264 #endif