aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorPaul Eggert2012-09-09 09:06:33 -0700
committerPaul Eggert2012-09-09 09:06:33 -0700
commitf6196b87e1ceee0d56f2fe6f3aa2b9d1d82c44b0 (patch)
tree3400f2f4898ce1fc39ad437faa5e55714129d30b /admin
parent8ed43f154827121c624a5a93808340618bd8f03f (diff)
downloademacs-f6196b87e1ceee0d56f2fe6f3aa2b9d1d82c44b0.tar.gz
emacs-f6196b87e1ceee0d56f2fe6f3aa2b9d1d82c44b0.zip
Assume C89 or later for math functions.
This simplifies the code, and makes it a bit smaller and faster, and (most important) makes it easier to clean up signal handling since we can stop worring about floating-point exceptions in library code. That was a problem before C89, but the problem went away many years ago on all practical Emacs targets. * configure.ac (frexp, fmod): Remove checks for these functions, as we now assume them. (FLOAT_CHECK_DOMAIN, HAVE_INVERSE_HYPERBOLIC, NO_MATHERR) (HAVE_EXCEPTION): Remove; no longer needed. * admin/CPP-DEFINES (HAVE_FMOD, HAVE_FREXP, FLOAT_CHECK_DOMAIN) (HAVE_INVERSE_HYPERBOLIC, NO_MATHERR): Remove. * src/data.c, src/image.c, src/lread.c, src/print.c: Don't include <math.h>; no longer needed. * src/data.c, src/floatfns.c (IEEE_FLOATING_POINT): Don't worry that it might be autoconfigured, as that never happens. * src/data.c (fmod): * src/doprnt.c (DBL_MAX_10_EXP): * src/print.c (DBL_DIG): Remove. C89 or later always defines these. * src/floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN) (in_float, float_error_arg, float_error_arg2, float_error_fn_name) (arith_error, domain_error, domain_error2): Remove all this pre-C89 cruft. Do not include <errno.h> as that's no longer needed -- we simply return what C returns. All uses removed. (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with the wrapped code. (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2): Remove. All uses expanded, as these macros are no longer used more than once and are now more trouble than they're worth. (Ftan): Use tan, not sin / cos. (Flogb): Assume C89 frexp. (fmod_float): Assume C89 fmod. (matherr) [HAVE_MATHERR]: Remove; no longer needed. (init_floatfns): Remove. All uses removed.
Diffstat (limited to 'admin')
-rw-r--r--admin/CPP-DEFINES5
-rw-r--r--admin/ChangeLog6
2 files changed, 6 insertions, 5 deletions
diff --git a/admin/CPP-DEFINES b/admin/CPP-DEFINES
index d87feb9b866..b40ba78e20d 100644
--- a/admin/CPP-DEFINES
+++ b/admin/CPP-DEFINES
@@ -107,7 +107,6 @@ EMACS_CONFIGURATION
107EMACS_CONFIG_OPTIONS 107EMACS_CONFIG_OPTIONS
108EMACS_INT 108EMACS_INT
109EMACS_UINT 109EMACS_UINT
110FLOAT_CHECK_DOMAIN
111GC_MARK_SECONDARY_STACK 110GC_MARK_SECONDARY_STACK
112GC_MARK_STACK 111GC_MARK_STACK
113GC_SETJMP_WORKS 112GC_SETJMP_WORKS
@@ -158,12 +157,10 @@ HAVE_ENDPWENT
158HAVE_ENVIRON_DECL 157HAVE_ENVIRON_DECL
159HAVE_EUIDACCESS 158HAVE_EUIDACCESS
160HAVE_FCNTL_H 159HAVE_FCNTL_H
161HAVE_FMOD
162HAVE_FORK 160HAVE_FORK
163HAVE_FPATHCONF 161HAVE_FPATHCONF
164HAVE_FREEIFADDRS 162HAVE_FREEIFADDRS
165HAVE_FREETYPE 163HAVE_FREETYPE
166HAVE_FREXP
167HAVE_FSEEKO 164HAVE_FSEEKO
168HAVE_FSYNC 165HAVE_FSYNC
169HAVE_FUTIMENS 166HAVE_FUTIMENS
@@ -217,7 +214,6 @@ HAVE_IFADDRS_H
217HAVE_IMAGEMAGICK 214HAVE_IMAGEMAGICK
218HAVE_INET_SOCKETS 215HAVE_INET_SOCKETS
219HAVE_INTTYPES_H 216HAVE_INTTYPES_H
220HAVE_INVERSE_HYPERBOLIC
221HAVE_JPEG 217HAVE_JPEG
222HAVE_KERBEROSIV_DES_H 218HAVE_KERBEROSIV_DES_H
223HAVE_KERBEROSIV_KRB_H 219HAVE_KERBEROSIV_KRB_H
@@ -429,7 +425,6 @@ MAIL_USE_SYSTEM_LOCK
429MAXPATHLEN 425MAXPATHLEN
430NLIST_STRUCT 426NLIST_STRUCT
431NO_EDITRES 427NO_EDITRES
432NO_MATHERR
433NO_TERMIO 428NO_TERMIO
434NSIG 429NSIG
435NSIG_MINIMUM 430NSIG_MINIMUM
diff --git a/admin/ChangeLog b/admin/ChangeLog
index 54fea2615fd..2c61f437981 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,3 +1,9 @@
12012-09-09 Paul Eggert <eggert@cs.ucla.edu>
2
3 Assume C89 or later for math functions (Bug#12381).
4 * CPP-DEFINES (HAVE_FMOD, HAVE_FREXP, FLOAT_CHECK_DOMAIN)
5 (HAVE_INVERSE_HYPERBOLIC, NO_MATHERR): Remove.
6
12012-09-04 Paul Eggert <eggert@cs.ucla.edu> 72012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2 8
3 Simplify redefinition of 'abort' (Bug#12316). 9 Simplify redefinition of 'abort' (Bug#12316).