Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
167ff177
Commit
167ff177
authored
Sep 21, 2000
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use PyOS_setsig() instead of signal(). Also remove redundant spaces
from the FreeBSD code.
parent
ccf3075e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
Modules/fpectlmodule.c
Modules/fpectlmodule.c
+15
-15
No files found.
Modules/fpectlmodule.c
View file @
167ff177
...
@@ -130,7 +130,7 @@ static void fpe_reset(Sigfunc *handler)
...
@@ -130,7 +130,7 @@ static void fpe_reset(Sigfunc *handler)
(
user_routine
*
)
0
,
(
user_routine
*
)
0
,
_ABORT_ON_ERROR
,
_ABORT_ON_ERROR
,
NULL
);
NULL
);
signal
(
SIGFPE
,
handler
);
PyOS_setsig
(
SIGFPE
,
handler
);
/*-- SunOS and Solaris ----------------------------------------------------*/
/*-- SunOS and Solaris ----------------------------------------------------*/
#elif defined(sun)
#elif defined(sun)
...
@@ -144,7 +144,7 @@ static void fpe_reset(Sigfunc *handler)
...
@@ -144,7 +144,7 @@ static void fpe_reset(Sigfunc *handler)
(
void
)
nonstandard_arithmetic
();
(
void
)
nonstandard_arithmetic
();
(
void
)
ieee_flags
(
"clearall"
,
mode
,
in
,
&
out
);
(
void
)
ieee_flags
(
"clearall"
,
mode
,
in
,
&
out
);
(
void
)
ieee_handler
(
"set"
,
"common"
,(
sigfpe_handler_type
)
handler
);
(
void
)
ieee_handler
(
"set"
,
"common"
,(
sigfpe_handler_type
)
handler
);
signal
(
SIGFPE
,
handler
);
PyOS_setsig
(
SIGFPE
,
handler
);
/*-- HPUX -----------------------------------------------------------------*/
/*-- HPUX -----------------------------------------------------------------*/
#elif defined(__hppa) || defined(hppa)
#elif defined(__hppa) || defined(hppa)
...
@@ -153,7 +153,7 @@ static void fpe_reset(Sigfunc *handler)
...
@@ -153,7 +153,7 @@ static void fpe_reset(Sigfunc *handler)
/* ld -b -o fpectlmodule.sl fpectlmodule.o -lm */
/* ld -b -o fpectlmodule.sl fpectlmodule.o -lm */
#include <math.h>
#include <math.h>
fpsetdefaults
();
fpsetdefaults
();
signal
(
SIGFPE
,
handler
);
PyOS_setsig
(
SIGFPE
,
handler
);
/*-- IBM AIX --------------------------------------------------------------*/
/*-- IBM AIX --------------------------------------------------------------*/
#elif defined(__AIX) || defined(_AIX)
#elif defined(__AIX) || defined(_AIX)
...
@@ -161,7 +161,7 @@ static void fpe_reset(Sigfunc *handler)
...
@@ -161,7 +161,7 @@ static void fpe_reset(Sigfunc *handler)
#include <fptrap.h>
#include <fptrap.h>
fp_trap
(
FP_TRAP_SYNC
);
fp_trap
(
FP_TRAP_SYNC
);
fp_enable
(
TRP_INVALID
|
TRP_DIV_BY_ZERO
|
TRP_OVERFLOW
);
fp_enable
(
TRP_INVALID
|
TRP_DIV_BY_ZERO
|
TRP_OVERFLOW
);
signal
(
SIGFPE
,
handler
);
PyOS_setsig
(
SIGFPE
,
handler
);
/*-- DEC ALPHA OSF --------------------------------------------------------*/
/*-- DEC ALPHA OSF --------------------------------------------------------*/
#elif defined(__alpha) && defined(__osf__)
#elif defined(__alpha) && defined(__osf__)
...
@@ -172,7 +172,7 @@ static void fpe_reset(Sigfunc *handler)
...
@@ -172,7 +172,7 @@ static void fpe_reset(Sigfunc *handler)
unsigned
long
fp_control
=
unsigned
long
fp_control
=
IEEE_TRAP_ENABLE_INV
|
IEEE_TRAP_ENABLE_DZE
|
IEEE_TRAP_ENABLE_OVF
;
IEEE_TRAP_ENABLE_INV
|
IEEE_TRAP_ENABLE_DZE
|
IEEE_TRAP_ENABLE_OVF
;
ieee_set_fp_control
(
fp_control
);
ieee_set_fp_control
(
fp_control
);
signal
(
SIGFPE
,
handler
);
PyOS_setsig
(
SIGFPE
,
handler
);
/*-- Cray Unicos ----------------------------------------------------------*/
/*-- Cray Unicos ----------------------------------------------------------*/
#elif defined(cray)
#elif defined(cray)
...
@@ -180,13 +180,13 @@ static void fpe_reset(Sigfunc *handler)
...
@@ -180,13 +180,13 @@ static void fpe_reset(Sigfunc *handler)
#ifdef HAS_LIBMSET
#ifdef HAS_LIBMSET
libmset
(
-
1
);
libmset
(
-
1
);
#endif
#endif
signal
(
SIGFPE
,
handler
);
PyOS_setsig
(
SIGFPE
,
handler
);
/*-- FreeBSD ----------------------------------------------------------------*/
/*-- FreeBSD ----------------------------------------------------------------*/
#elif defined(__FreeBSD__)
#elif defined(__FreeBSD__)
fpresetsticky
(
fpgetsticky
()
);
fpresetsticky
(
fpgetsticky
()
);
fpsetmask
(
FP_X_INV
|
FP_X_DZ
|
FP_X_OFL
);
fpsetmask
(
FP_X_INV
|
FP_X_DZ
|
FP_X_OFL
);
signal
(
SIGFPE
,
handler
);
PyOS_setsig
(
SIGFPE
,
handler
);
/*-- Linux ----------------------------------------------------------------*/
/*-- Linux ----------------------------------------------------------------*/
#elif defined(linux)
#elif defined(linux)
...
@@ -196,13 +196,13 @@ static void fpe_reset(Sigfunc *handler)
...
@@ -196,13 +196,13 @@ static void fpe_reset(Sigfunc *handler)
#include <i386/fpu_control.h>
#include <i386/fpu_control.h>
#endif
#endif
__setfpucw
(
0x1372
);
__setfpucw
(
0x1372
);
signal
(
SIGFPE
,
handler
);
PyOS_setsig
(
SIGFPE
,
handler
);
/*-- NeXT -----------------------------------------------------------------*/
/*-- NeXT -----------------------------------------------------------------*/
#elif defined(NeXT) && defined(m68k) && defined(__GNUC__)
#elif defined(NeXT) && defined(m68k) && defined(__GNUC__)
/* NeXT needs explicit csr set to generate SIGFPE */
/* NeXT needs explicit csr set to generate SIGFPE */
asm
(
"fmovel #0x1400,fpcr"
);
/* set OVFL and ZD bits */
asm
(
"fmovel #0x1400,fpcr"
);
/* set OVFL and ZD bits */
signal
(
SIGFPE
,
handler
);
PyOS_setsig
(
SIGFPE
,
handler
);
/*-- Microsoft Windows, NT ------------------------------------------------*/
/*-- Microsoft Windows, NT ------------------------------------------------*/
#elif defined(_MSC_VER)
#elif defined(_MSC_VER)
...
@@ -211,7 +211,7 @@ static void fpe_reset(Sigfunc *handler)
...
@@ -211,7 +211,7 @@ static void fpe_reset(Sigfunc *handler)
#include <float.h>
#include <float.h>
unsigned
int
cw
=
_EM_INVALID
|
_EM_ZERODIVIDE
|
_EM_OVERFLOW
;
unsigned
int
cw
=
_EM_INVALID
|
_EM_ZERODIVIDE
|
_EM_OVERFLOW
;
(
void
)
_controlfp
(
0
,
cw
);
(
void
)
_controlfp
(
0
,
cw
);
signal
(
SIGFPE
,
handler
);
PyOS_setsig
(
SIGFPE
,
handler
);
/*-- Give Up --------------------------------------------------------------*/
/*-- Give Up --------------------------------------------------------------*/
#else
#else
...
@@ -223,12 +223,12 @@ static void fpe_reset(Sigfunc *handler)
...
@@ -223,12 +223,12 @@ static void fpe_reset(Sigfunc *handler)
static
PyObject
*
turnoff_sigfpe
(
PyObject
*
self
,
PyObject
*
args
)
static
PyObject
*
turnoff_sigfpe
(
PyObject
*
self
,
PyObject
*
args
)
{
{
#ifdef __FreeBSD__
#ifdef __FreeBSD__
fpresetsticky
(
fpgetsticky
()
);
fpresetsticky
(
fpgetsticky
()
);
fpsetmask
(
0
);
fpsetmask
(
0
);
#else
#else
fputs
(
"Operation not implemented
\n
"
,
stderr
);
fputs
(
"Operation not implemented
\n
"
,
stderr
);
#endif
#endif
Py_INCREF
(
Py_None
);
Py_INCREF
(
Py_None
);
return
Py_None
;
return
Py_None
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment