summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2017-05-22 12:33:48 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2017-05-22 12:33:48 +0000
commite0ebd703cfe57e32aed1f960417f9d9edfb848f5 (patch)
tree69092b6519c1c4714b323315792d030a1bc25ba5
parent7cb2e704590a6228d5a4c189c0883473d4c5db4c (diff)
downloadmpfr-e0ebd703cfe57e32aed1f960417f9d9edfb848f5.tar.gz
[src/mpfr-intmax.h] Define mpfr_intmax_t as being the largest
signed integer type available for the MPFR build. It will be useful for the formatted output functions (src/vasprintf.c) to handle the 'n' format specifier, assuming that the value may be larger than INT_MAX, which is possible assuming that the C standard has a defect in the corresponding specification: https://sourceware.org/bugzilla/show_bug.cgi?id=21360 git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@11519 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r--src/mpfr-intmax.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mpfr-intmax.h b/src/mpfr-intmax.h
index c982dd8ff..8fba6c4f8 100644
--- a/src/mpfr-intmax.h
+++ b/src/mpfr-intmax.h
@@ -47,9 +47,19 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
# include <inttypes.h>
# define MPFR_USE_INTMAX_T
#endif
+
#if HAVE_STDINT_H
# include <stdint.h>
# define MPFR_USE_INTMAX_T
#endif
+/* Largest signed integer type available for the MPFR build. */
+#if defined(MPFR_USE_INTMAX_T)
+typedef intmax_t mpfr_intmax_t;
+#elif defined(HAVE_LONG_LONG)
+typedef long long mpfr_intmax_t;
+#else
+typedef long mpfr_intmax_t;
+#endif
+
#endif