diff options
Diffstat (limited to 'src/floatfns.c')
| -rw-r--r-- | src/floatfns.c | 39 |
1 files changed, 2 insertions, 37 deletions
diff --git a/src/floatfns.c b/src/floatfns.c index cad071f1e15..f59cf58228a 100644 --- a/src/floatfns.c +++ b/src/floatfns.c | |||
| @@ -37,9 +37,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 37 | Define FLOAT_CHECK_ERRNO if the float library routines set errno. | 37 | Define FLOAT_CHECK_ERRNO if the float library routines set errno. |
| 38 | This has no effect if HAVE_MATHERR is defined. | 38 | This has no effect if HAVE_MATHERR is defined. |
| 39 | 39 | ||
| 40 | Define FLOAT_CATCH_SIGILL if the float library routines signal SIGILL. | ||
| 41 | (What systems actually do this? Please let us know.) | ||
| 42 | |||
| 43 | Define FLOAT_CHECK_DOMAIN if the float library doesn't handle errors by | 40 | Define FLOAT_CHECK_DOMAIN if the float library doesn't handle errors by |
| 44 | either setting errno, or signaling SIGFPE/SIGILL. Otherwise, domain and | 41 | either setting errno, or signaling SIGFPE/SIGILL. Otherwise, domain and |
| 45 | range checking will happen before calling the float routines. This has | 42 | range checking will happen before calling the float routines. This has |
| @@ -99,14 +96,10 @@ extern double logb (double); | |||
| 99 | # include <errno.h> | 96 | # include <errno.h> |
| 100 | #endif | 97 | #endif |
| 101 | 98 | ||
| 102 | #ifdef FLOAT_CATCH_SIGILL | 99 | /* True while executing in floating point. |
| 103 | static void float_error (); | ||
| 104 | #endif | ||
| 105 | |||
| 106 | /* Nonzero while executing in floating point. | ||
| 107 | This tells float_error what to do. */ | 100 | This tells float_error what to do. */ |
| 108 | 101 | ||
| 109 | static int in_float; | 102 | static bool in_float; |
| 110 | 103 | ||
| 111 | /* If an argument is out of range for a mathematical function, | 104 | /* If an argument is out of range for a mathematical function, |
| 112 | here is the actual argument value to use in the error message. | 105 | here is the actual argument value to use in the error message. |
| @@ -947,31 +940,6 @@ Rounds the value toward zero. */) | |||
| 947 | return make_float (d); | 940 | return make_float (d); |
| 948 | } | 941 | } |
| 949 | 942 | ||
| 950 | #ifdef FLOAT_CATCH_SIGILL | ||
| 951 | static void | ||
| 952 | float_error (int signo) | ||
| 953 | { | ||
| 954 | if (! in_float) | ||
| 955 | fatal_error_signal (signo); | ||
| 956 | |||
| 957 | #ifdef BSD_SYSTEM | ||
| 958 | sigsetmask (SIGEMPTYMASK); | ||
| 959 | #else | ||
| 960 | /* Must reestablish handler each time it is called. */ | ||
| 961 | signal (SIGILL, float_error); | ||
| 962 | #endif /* BSD_SYSTEM */ | ||
| 963 | |||
| 964 | SIGNAL_THREAD_CHECK (signo); | ||
| 965 | in_float = 0; | ||
| 966 | |||
| 967 | xsignal1 (Qarith_error, float_error_arg); | ||
| 968 | } | ||
| 969 | |||
| 970 | /* Another idea was to replace the library function `infnan' | ||
| 971 | where SIGILL is signaled. */ | ||
| 972 | |||
| 973 | #endif /* FLOAT_CATCH_SIGILL */ | ||
| 974 | |||
| 975 | #ifdef HAVE_MATHERR | 943 | #ifdef HAVE_MATHERR |
| 976 | int | 944 | int |
| 977 | matherr (struct exception *x) | 945 | matherr (struct exception *x) |
| @@ -1006,9 +974,6 @@ matherr (struct exception *x) | |||
| 1006 | void | 974 | void |
| 1007 | init_floatfns (void) | 975 | init_floatfns (void) |
| 1008 | { | 976 | { |
| 1009 | #ifdef FLOAT_CATCH_SIGILL | ||
| 1010 | signal (SIGILL, float_error); | ||
| 1011 | #endif | ||
| 1012 | in_float = 0; | 977 | in_float = 0; |
| 1013 | } | 978 | } |
| 1014 | 979 | ||