diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-01-20 21:27:34 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-01-20 21:27:34 (GMT) |
commit | 7172f507e18212dbc3afe53ce9dbdc696753c94c (patch) | |
tree | a1755398d60e77d8ff874b985693c1e079869ee6 | |
parent | 6a0514ea20a516ca5973b913cf58289561a57342 (diff) | |
download | cpython-7172f507e18212dbc3afe53ce9dbdc696753c94c.zip cpython-7172f507e18212dbc3afe53ce9dbdc696753c94c.tar.gz cpython-7172f507e18212dbc3afe53ce9dbdc696753c94c.tar.bz2 |
Replace fpgetmask() with fedisableexcept()
Issue #24520: On FreeBSD, fpgetmask() was deprecated long time ago.
fedisableexcept() is now preferred.
-rw-r--r-- | Programs/python.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Programs/python.c b/Programs/python.c index 2e5e4e3..37b10b8 100644 --- a/Programs/python.c +++ b/Programs/python.c @@ -4,7 +4,7 @@ #include <locale.h> #ifdef __FreeBSD__ -#include <floatingpoint.h> +#include <fenv.h> #endif #ifdef MS_WINDOWS @@ -23,9 +23,6 @@ main(int argc, char **argv) wchar_t **argv_copy2; int i, res; char *oldloc; -#ifdef __FreeBSD__ - fp_except_t m; -#endif argv_copy = (wchar_t **)PyMem_RawMalloc(sizeof(wchar_t*) * (argc+1)); argv_copy2 = (wchar_t **)PyMem_RawMalloc(sizeof(wchar_t*) * (argc+1)); @@ -40,8 +37,7 @@ main(int argc, char **argv) * exceptions by default. Here we disable them. */ #ifdef __FreeBSD__ - m = fpgetmask(); - fpsetmask(m & ~FP_X_OFL); + fedisableexcept(FE_OVERFLOW); #endif oldloc = _PyMem_RawStrdup(setlocale(LC_ALL, NULL)); |