summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2014-05-30 13:19:29 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2014-05-30 13:19:29 -0700
commit1915d8d63cb4de3b7fcadf059f1fe7f20fc5f8bf (patch)
treeb91c84b78c5610a2f218b00036843cf9f52a6248 /lib
parentff66db795045b919717b16288ac083f6eafbdcb0 (diff)
downloademacs-1915d8d63cb4de3b7fcadf059f1fe7f20fc5f8bf.tar.gz
Fix port to 32-bit AIX with xlc.
This doesn't fix Bug#17598, but it does fix a regression since Emacs built with xlc until recently, and perhaps it'll help us fix Bug#17598. * configure.ac (GC_SETJMP_WORKS): Define for AIX, too. Merge from gnulib, incorporating: 2014-05-30 ftoastr: work around compiler bug in IBM xlc 12.1 * lib/ftoastr.c: Update from gnulib. * src/alloc.c (gdb_make_enums_visible): Remove FLOAT_TO_STRING_BUFSIZE. * src/conf_post.h (FLEXIBLE_ARRAY_MEMBER) [__IBMC__]: Don't define to empty. * src/lisp.h (FLOAT_TO_STRING_BUFSIZE): Make it a macro, instead of an enum, to work around a compiler bug in IBM xlc 12.1.
Diffstat (limited to 'lib')
-rw-r--r--lib/ftoastr.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/ftoastr.h b/lib/ftoastr.h
index 6236292d9d9..26cad7369ce 100644
--- a/lib/ftoastr.h
+++ b/lib/ftoastr.h
@@ -72,12 +72,13 @@ enum
/* _GL_FLT_PREC_BOUND is an upper bound on the precision needed to
represent a float value without losing information. Likewise for
- _GL_DBL_PREC_BOUND and double, and _GL_LDBL_PREC_BOUND and long double. */
+ _GL_DBL_PREC_BOUND and double, and _GL_LDBL_PREC_BOUND and long double.
+ These are macros, not enums, to work around a bug in IBM xlc 12.1. */
#if FLT_RADIX == 10 /* decimal floating point */
- enum { _GL_FLT_PREC_BOUND = FLT_MANT_DIG };
- enum { _GL_DBL_PREC_BOUND = DBL_MANT_DIG };
- enum { _GL_LDBL_PREC_BOUND = LDBL_MANT_DIG };
+# define _GL_FLT_PREC_BOUND FLT_MANT_DIG
+# define _GL_DBL_PREC_BOUND DBL_MANT_DIG
+# define _GL_LDBL_PREC_BOUND LDBL_MANT_DIG
#else
/* An upper bound on the number of bits needed to represent a single
@@ -95,13 +96,13 @@ enum
DIG digits. For why the "+ 1" is needed, see "Binary to Decimal
Conversion" in David Goldberg's paper "What Every Computer
Scientist Should Know About Floating-Point Arithmetic"
- <http://docs.sun.com/source/806-3568/ncg_goldberg.html>. */
+ <http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html>. */
# define _GL_FLOAT_PREC_BOUND(dig) \
(INT_BITS_STRLEN_BOUND ((dig) * _GL_FLOAT_DIG_BITS_BOUND) + 1)
- enum { _GL_FLT_PREC_BOUND = _GL_FLOAT_PREC_BOUND ( FLT_MANT_DIG) };
- enum { _GL_DBL_PREC_BOUND = _GL_FLOAT_PREC_BOUND ( DBL_MANT_DIG) };
- enum { _GL_LDBL_PREC_BOUND = _GL_FLOAT_PREC_BOUND (LDBL_MANT_DIG) };
+# define _GL_FLT_PREC_BOUND _GL_FLOAT_PREC_BOUND ( FLT_MANT_DIG)
+# define _GL_DBL_PREC_BOUND _GL_FLOAT_PREC_BOUND ( DBL_MANT_DIG)
+# define _GL_LDBL_PREC_BOUND _GL_FLOAT_PREC_BOUND (LDBL_MANT_DIG)
#endif