aboutsummaryrefslogtreecommitdiffstats
path: root/src/lisp.h
diff options
context:
space:
mode:
authorPaul Eggert2018-08-01 18:53:31 -0700
committerPaul Eggert2018-08-01 19:01:51 -0700
commitd216d7d248199aa6c99cd642116717c5b301ae6d (patch)
tree687b9efadbb87fa1095fb0a2e0569e625856e15a /src/lisp.h
parent2f37ecaefcc61b0bf389f1c1eb3ac1b15105f056 (diff)
downloademacs-d216d7d248199aa6c99cd642116717c5b301ae6d.tar.gz
emacs-d216d7d248199aa6c99cd642116717c5b301ae6d.zip
Substitute a <ieee754.h> on hosts lacking it
* .gitignore: Add lib/ieee754.h. * admin/merge-gnulib (GNULIB_MODULES): Add ieee754-h. * configure.ac: Remove ieee754.h check, as Gnulib now does that. * etc/NEWS: Mention this. * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate. * lib/ieee754.in.h, m4/ieee754-h.m4: New files, from Gnulib. * src/lisp.h (IEEE_FLOATING_POINT): Now a macro so that it can be used in #if. * src/lread.c, src/print.c: Include <ieee754.h> if IEEE_FLOATING_POINT, not if HAVE_IEEE754_H. * src/lread.c (string_to_number): * src/print.c (float_to_string): Process NaNs only on IEEE hosts, and assume <ieee754.h> in that case.
Diffstat (limited to 'src/lisp.h')
-rw-r--r--src/lisp.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/lisp.h b/src/lisp.h
index 96de60e4670..bdece817bd6 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2670,17 +2670,14 @@ XFLOAT_DATA (Lisp_Object f)
2670 2670
2671/* Most hosts nowadays use IEEE floating point, so they use IEC 60559 2671/* Most hosts nowadays use IEEE floating point, so they use IEC 60559
2672 representations, have infinities and NaNs, and do not trap on 2672 representations, have infinities and NaNs, and do not trap on
2673 exceptions. Define IEEE_FLOATING_POINT if this host is one of the 2673 exceptions. Define IEEE_FLOATING_POINT to 1 if this host is one of the
2674 typical ones. The C11 macro __STDC_IEC_559__ is close to what is 2674 typical ones. The C11 macro __STDC_IEC_559__ is close to what is
2675 wanted here, but is not quite right because Emacs does not require 2675 wanted here, but is not quite right because Emacs does not require
2676 all the features of C11 Annex F (and does not require C11 at all, 2676 all the features of C11 Annex F (and does not require C11 at all,
2677 for that matter). */ 2677 for that matter). */
2678enum 2678
2679 { 2679#define IEEE_FLOATING_POINT (FLT_RADIX == 2 && FLT_MANT_DIG == 24 \
2680 IEEE_FLOATING_POINT 2680 && FLT_MIN_EXP == -125 && FLT_MAX_EXP == 128)
2681 = (FLT_RADIX == 2 && FLT_MANT_DIG == 24
2682 && FLT_MIN_EXP == -125 && FLT_MAX_EXP == 128)
2683 };
2684 2681
2685/* A character, declared with the following typedef, is a member 2682/* A character, declared with the following typedef, is a member
2686 of some character set associated with the current buffer. */ 2683 of some character set associated with the current buffer. */