summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2021-02-08 16:40:51 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2021-02-08 16:40:51 +0000
commit673cff83d5e556678e85000336e0fbf42616cb35 (patch)
tree68ec5febef4bc066400c931d234f022fa281d0d1 /src
parentc83b2d35a2c102541c0b40e5d75400ecd51a169d (diff)
downloadmpfr-673cff83d5e556678e85000336e0fbf42616cb35.tar.gz
[src/mpfr.h] Updated comments on the types for mpfr_prec_t/mpfr_exp_t.
* For mpfr_prec_t, removed the comment saying that under Windows 64, "long long" could be used (this would imply that mpfr_prec_t and mpfr_exp_t will not fit in a long, and this is not supported yet, see below). * For mpfr_exp_t and _MPFR_EXP_FORMAT == 4, changed an unclear note and added other information; in particular, this value is currently not supported since the MPFR code assumes that mpfr_exp_t fits in a long. git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14408 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'src')
-rw-r--r--src/mpfr.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/mpfr.h b/src/mpfr.h
index e98c6530b..c8c9c4e77 100644
--- a/src/mpfr.h
+++ b/src/mpfr.h
@@ -162,9 +162,6 @@ typedef unsigned short mpfr_uprec_t;
typedef int mpfr_prec_t;
typedef unsigned int mpfr_uprec_t;
#elif _MPFR_PREC_FORMAT == 3
-/* we could use "long long" under Windows 64 here, which can be tested
- with the macro _WIN64 according to
- https://sourceforge.net/p/predef/wiki/OperatingSystems/ */
typedef long mpfr_prec_t;
typedef unsigned long mpfr_uprec_t;
#else
@@ -196,8 +193,19 @@ typedef long mpfr_exp_t;
typedef unsigned long mpfr_uexp_t;
#elif _MPFR_EXP_FORMAT == 4
/* Note: in this case, intmax_t and uintmax_t must be defined before
- the inclusion of mpfr.h (we do not include <stdint.h> here because
- of some non-ISO C99 implementations that support these types). */
+ the inclusion of mpfr.h (we do not include <stdint.h> here due to
+ potential issues with non-ISO implementations, on which there are
+ alternative ways to define these types).
+ In all known implementations, intmax_t has exactly 64 bits and is
+ equivalent to long long when defined, but when long has 64 bits,
+ it may be defined as long by <stdint.h> for better portability
+ with old compilers, thus offers more flexibility than long long.
+ This may change in the future.
+ This _MPFR_EXP_FORMAT value is currently not supported since the
+ MPFR code assumes that mpfr_exp_t fits in a long. Some examples
+ of problematic code can be obtained with:
+ grep -E 'mpfr_cmp_[su]i *\(.*__gmpfr_em' *.c
+*/
typedef intmax_t mpfr_exp_t;
typedef uintmax_t mpfr_uexp_t;
#else