summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tclTomMath.h4
-rw-r--r--libtommath/bn_mp_get_long_long.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/generic/tclTomMath.h b/generic/tclTomMath.h
index bbcb4bc..9da642e 100644
--- a/generic/tclTomMath.h
+++ b/generic/tclTomMath.h
@@ -84,7 +84,11 @@ typedef unsigned int mp_digit;
#define MP_DIGIT_DECLARED
#endif
#ifndef MP_WORD_DECLARED
+#ifdef _WIN32
+typedef unsigned __int64 mp_word;
+#else
typedef unsigned long long mp_word;
+#endif
#define MP_WORD_DECLARED
#endif
diff --git a/libtommath/bn_mp_get_long_long.c b/libtommath/bn_mp_get_long_long.c
index 49a0208..333c6d1 100644
--- a/libtommath/bn_mp_get_long_long.c
+++ b/libtommath/bn_mp_get_long_long.c
@@ -26,11 +26,11 @@ Tcl_WideUInt mp_get_long_long(const mp_int *a)
i = MIN(a->used, (((CHAR_BIT * (int)sizeof(Tcl_WideUInt)) + DIGIT_BIT - 1) / DIGIT_BIT)) - 1;
/* get most significant digit of result */
- res = (unsigned long long)a->dp[i];
+ res = (Tcl_WideUInt)a->dp[i];
#if DIGIT_BIT < 64
while (--i >= 0) {
- res = (res << DIGIT_BIT) | (unsigned long long)a->dp[i];
+ res = (res << DIGIT_BIT) | (Tcl_WideUInt)a->dp[i];
}
#endif
return res;