summaryrefslogtreecommitdiff
path: root/gmpxx.h
diff options
context:
space:
mode:
authorMarc Glisse <marc.glisse@inria.fr>2011-03-15 19:22:57 +0100
committerMarc Glisse <marc.glisse@inria.fr>2011-03-15 19:22:57 +0100
commit28697e242e1c742df162196f34531d81e21305a4 (patch)
tree5f97869d011c525ecc774d1f477dcaac05f72cc8 /gmpxx.h
parentf63f64d3b0b40400d7653f320fbd57548217f136 (diff)
downloadgmp-28697e242e1c742df162196f34531d81e21305a4.tar.gz
Make __GMPZ_ULI_LIMBS more preprocessor-friendly.
Diffstat (limited to 'gmpxx.h')
-rw-r--r--gmpxx.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/gmpxx.h b/gmpxx.h
index a53d742df..7865c1caa 100644
--- a/gmpxx.h
+++ b/gmpxx.h
@@ -42,8 +42,14 @@ along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
// Max allocations for plain types when converted to mpz_t
#define __GMPZ_DBL_LIMBS (2 + DBL_MAX_EXP / GMP_NUMB_BITS)
-#define __GMPZ_ULI_LIMBS (1 + (8 * sizeof (long) - 1) / GMP_NUMB_BITS)
+#if GMP_NAIL_BITS != 0 && ! defined _LONG_LONG_LIMB
+#define __GMPZ_ULI_LIMBS 2
+#else
+#define __GMPZ_ULI_LIMBS 1
+#endif
+
+// Fake temporary variables
#define __GMPXX_TMPZ_UI \
mpz_t temp; \
mp_limb_t limbs[__GMPZ_ULI_LIMBS]; \