summaryrefslogtreecommitdiffstatshomepage
path: root/py/mpz.h
diff options
context:
space:
mode:
Diffstat (limited to 'py/mpz.h')
-rw-r--r--py/mpz.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/py/mpz.h b/py/mpz.h
index 9dbbbc373a..35e06c5658 100644
--- a/py/mpz.h
+++ b/py/mpz.h
@@ -36,7 +36,7 @@
// depending on the machine, but it (and MPZ_DIG_SIZE) can be freely changed so
// long as the constraints mentioned above are met.
-#if defined(__x86_64__)
+#if defined(__x86_64__) || defined(_WIN64)
// 64-bit machine, using 32-bit storage for digits
typedef uint32_t mpz_dig_t;
typedef uint64_t mpz_dbl_dig_t;
@@ -50,6 +50,12 @@ typedef int32_t mpz_dbl_dig_signed_t;
#define MPZ_DIG_SIZE (16)
#endif
+#ifdef _WIN64
+ #define MPZ_LONG_1 1i64
+#else
+ #define MPZ_LONG_1 1L
+#endif
+
#define MPZ_NUM_DIG_FOR_INT (sizeof(mp_int_t) * 8 / MPZ_DIG_SIZE + 1)
#define MPZ_NUM_DIG_FOR_LL (sizeof(long long) * 8 / MPZ_DIG_SIZE + 1)