summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tclBasic.c2
-rw-r--r--generic/tclBinary.c3
-rw-r--r--generic/tclExecute.c4
-rw-r--r--generic/tclObj.c2
-rw-r--r--generic/tclScan.c6
-rw-r--r--generic/tclStrToD.c38
-rw-r--r--generic/tclStubInit.c35
-rw-r--r--generic/tclTomMath.decls36
-rw-r--r--generic/tclTomMath.h4
-rw-r--r--generic/tclTomMathDecls.h113
-rw-r--r--libtommath/tommath.h22
-rw-r--r--unix/Makefile.in28
-rw-r--r--win/Makefile.in7
-rw-r--r--win/makefile.vc9
-rw-r--r--win/rules.vc2
-rw-r--r--win/tclWinPort.h6
16 files changed, 164 insertions, 153 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index d8fc01f..ca6b9f9 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -7891,7 +7891,7 @@ ExprAbsFunc(
}
goto unChanged;
} else if (l == WIDE_MIN) {
- mp_init_ll(&big, l);
+ mp_init_i64(&big, l);
goto tooLarge;
}
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(-l));
diff --git a/generic/tclBinary.c b/generic/tclBinary.c
index 34e8fa6..8ba0fab 100644
--- a/generic/tclBinary.c
+++ b/generic/tclBinary.c
@@ -2349,8 +2349,7 @@ ScanNumber(
Tcl_Obj *bigObj = NULL;
mp_int big;
- if (mp_init(&big) == MP_OKAY) {
- mp_set_u64(&big, uwvalue);
+ if (mp_init_u64(&big, uwvalue) == MP_OKAY) {
bigObj = Tcl_NewBignumObj(&big);
}
return bigObj;
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 5f2ae4c..a2f8ad5 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -8072,7 +8072,7 @@ ExecuteExtendedBinaryMathOp(
* Arguments are opposite sign; remainder is sum.
*/
- mp_init_ll(&big1, w1);
+ mp_init_i64(&big1, w1);
mp_add(&big2, &big1, &big2);
mp_clear(&big1);
BIG_RESULT(&big2);
@@ -8701,7 +8701,7 @@ ExecuteExtendedUnaryMathOp(
if (w != WIDE_MIN) {
WIDE_RESULT(-w);
}
- mp_init_ll(&big, w);
+ mp_init_i64(&big, w);
break;
default:
Tcl_TakeBignumFromObj(NULL, valuePtr, &big);
diff --git a/generic/tclObj.c b/generic/tclObj.c
index 82038df..eb9334e 100644
--- a/generic/tclObj.c
+++ b/generic/tclObj.c
@@ -3604,7 +3604,7 @@ GetBignumFromObj(
return TCL_OK;
}
if (objPtr->typePtr == &tclIntType) {
- mp_init_ll(bignumValue,
+ mp_init_i64(bignumValue,
objPtr->internalRep.wideValue);
return TCL_OK;
}
diff --git a/generic/tclScan.c b/generic/tclScan.c
index 50a3fe3..ba24ecf 100644
--- a/generic/tclScan.c
+++ b/generic/tclScan.c
@@ -929,13 +929,12 @@ Tcl_ScanObjCmd(
}
if ((flags & SCAN_UNSIGNED) && (wideValue < 0)) {
mp_int big;
- if (mp_init(&big) != MP_OKAY) {
+ if (mp_init_u64(&big, (Tcl_WideUInt)wideValue) != MP_OKAY) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"insufficient memory to create bignum", -1));
Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
return TCL_ERROR;
} else {
- mp_set_u64(&big, (Tcl_WideUInt)wideValue);
Tcl_SetBignumObj(objPtr, &big);
}
} else {
@@ -976,13 +975,12 @@ Tcl_ScanObjCmd(
if ((flags & SCAN_UNSIGNED) && (value < 0)) {
#ifdef TCL_WIDE_INT_IS_LONG
mp_int big;
- if (mp_init(&big) != MP_OKAY) {
+ if (mp_init_u64(&big, (unsigned long)value) != MP_OKAY) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"insufficient memory to create bignum", -1));
Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
return TCL_ERROR;
} else {
- mp_set_u64(&big, (unsigned long)value);
Tcl_SetBignumObj(objPtr, &big);
}
#else
diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c
index d46c852..0ad5979 100644
--- a/generic/tclStrToD.c
+++ b/generic/tclStrToD.c
@@ -711,7 +711,7 @@ TclParseNumber(
|| (octalSignificandWide >
((Tcl_WideUInt)-1 >> shift)))) {
octalSignificandOverflow = 1;
- mp_init_ull(&octalSignificandBig,
+ mp_init_u64(&octalSignificandBig,
octalSignificandWide);
}
}
@@ -828,7 +828,7 @@ TclParseNumber(
((size_t)shift >= CHAR_BIT*sizeof(Tcl_WideUInt) ||
significandWide > ((Tcl_WideUInt)-1 >> shift))) {
significandOverflow = 1;
- mp_init_ull(&significandBig,
+ mp_init_u64(&significandBig,
significandWide);
}
}
@@ -869,7 +869,7 @@ TclParseNumber(
((size_t)shift >= CHAR_BIT*sizeof(Tcl_WideUInt) ||
significandWide > ((Tcl_WideUInt)-1 >> shift))) {
significandOverflow = 1;
- mp_init_ull(&significandBig,
+ mp_init_u64(&significandBig,
significandWide);
}
}
@@ -1214,7 +1214,7 @@ TclParseNumber(
((size_t)shift >= CHAR_BIT*sizeof(Tcl_WideUInt) ||
significandWide > (MOST_BITS + signum) >> shift)) {
significandOverflow = 1;
- mp_init_ull(&significandBig, significandWide);
+ mp_init_u64(&significandBig, significandWide);
}
if (shift) {
if (!significandOverflow) {
@@ -1235,7 +1235,7 @@ TclParseNumber(
((size_t)shift >= CHAR_BIT*sizeof(Tcl_WideUInt) ||
significandWide > (MOST_BITS + signum) >> shift)) {
significandOverflow = 1;
- mp_init_ull(&significandBig, significandWide);
+ mp_init_u64(&significandBig, significandWide);
}
if (shift) {
if (!significandOverflow) {
@@ -1256,7 +1256,7 @@ TclParseNumber(
((size_t)shift >= CHAR_BIT*sizeof(Tcl_WideUInt) ||
octalSignificandWide > (MOST_BITS + signum) >> shift)) {
octalSignificandOverflow = 1;
- mp_init_ull(&octalSignificandBig,
+ mp_init_u64(&octalSignificandBig,
octalSignificandWide);
}
if (shift) {
@@ -1269,7 +1269,7 @@ TclParseNumber(
}
if (!octalSignificandOverflow) {
if (octalSignificandWide > (MOST_BITS + signum)) {
- mp_init_ull(&octalSignificandBig,
+ mp_init_u64(&octalSignificandBig,
octalSignificandWide);
octalSignificandOverflow = 1;
} else {
@@ -1297,12 +1297,12 @@ TclParseNumber(
&significandWide, &significandBig, significandOverflow);
if (!significandOverflow && (significandWide > MOST_BITS+signum)){
significandOverflow = 1;
- mp_init_ull(&significandBig, significandWide);
+ mp_init_u64(&significandBig, significandWide);
}
returnInteger:
if (!significandOverflow) {
if (significandWide > MOST_BITS+signum) {
- mp_init_ull(&significandBig,
+ mp_init_u64(&significandBig,
significandWide);
significandOverflow = 1;
} else {
@@ -1457,7 +1457,7 @@ AccumulateDecimalDigit(
* bignum and fall through into the bignum case.
*/
- mp_init_ull(bignumRepPtr, w);
+ mp_init_u64(bignumRepPtr, w);
} else {
/*
* Wide multiplication.
@@ -1600,7 +1600,7 @@ MakeLowPrecisionDouble(
* call MakeHighPrecisionDouble to do it the hard way.
*/
- mp_init_ull(&significandBig, significand);
+ mp_init_u64(&significandBig, significand);
retval = MakeHighPrecisionDouble(0, &significandBig, numSigDigs,
exponent);
mp_clear(&significandBig);
@@ -1889,7 +1889,7 @@ RefineApproximation(
scale = binExponent - mantBits - 1;
- mp_set(&twoMv, 1);
+ mp_set_u64(&twoMv, 1);
for (i=0; i<=8; ++i) {
if (M5 & (1 << i)) {
mp_mul(&twoMv, pow5+i, &twoMv);
@@ -3267,7 +3267,7 @@ ShorteningBignumConversionPowD(
* mminus = 5**m5
*/
- mp_init_ull(&b, bw);
+ mp_init_u64(&b, bw);
mp_init_set(&mminus, 1);
MulPow5(&b, b5, &b);
mp_mul_2d(&b, b2, &b);
@@ -3451,7 +3451,7 @@ StrictBignumConversionPowD(
* b = bw * 2**b2 * 5**b5
*/
- mp_init_ull(&b, bw);
+ mp_init_u64(&b, bw);
MulPow5(&b, b5, &b);
mp_mul_2d(&b, b2, &b);
@@ -3651,7 +3651,7 @@ ShorteningBignumConversion(
* S = 2**s2 * 5*s5
*/
- mp_init_ull(&b, bw);
+ mp_init_u64(&b, bw);
mp_mul_2d(&b, b2, &b);
mp_init_set(&S, 1);
MulPow5(&S, s5, &S); mp_mul_2d(&S, s2, &S);
@@ -3860,7 +3860,7 @@ StrictBignumConversion(
*/
mp_init_multi(&dig, NULL);
- mp_init_ull(&b, bw);
+ mp_init_u64(&b, bw);
mp_mul_2d(&b, b2, &b);
mp_init_set(&S, 1);
MulPow5(&S, s5, &S); mp_mul_2d(&S, s2, &S);
@@ -4381,11 +4381,11 @@ TclInitDoubleConversion(void)
for (i=0; i<9; ++i) {
mp_init(pow5 + i);
}
- mp_set(pow5, 5);
+ mp_set_u64(pow5, 5);
for (i=0; i<8; ++i) {
mp_sqr(pow5+i, pow5+i+1);
}
- mp_init_ul(pow5_13, 1220703125);
+ mp_init_u64(pow5_13, 1220703125);
for (i = 1; i < 5; ++i) {
mp_init(pow5_13 + i);
mp_sqr(pow5_13 + i - 1, pow5_13 + i);
@@ -4503,7 +4503,7 @@ Tcl_InitBignumFromDouble(
Tcl_WideInt w = (Tcl_WideInt) ldexp(fract, mantBits);
int shift = expt - mantBits;
- mp_init_ll(b, w);
+ mp_init_i64(b, w);
if (shift < 0) {
mp_div_2d(b, -shift, b, NULL);
} else if (shift > 0) {
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index 0ae187a..c54d78a 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -79,16 +79,13 @@
#define TclBN_mp_div_2d mp_div_2d
#define TclBN_mp_exch mp_exch
#define TclBN_mp_get_mag_u64 mp_get_mag_u64
-#define TclBN_mp_get_mag_ul mp_get_mag_ul
#define TclBN_mp_grow mp_grow
#define TclBN_mp_init mp_init
#define TclBN_mp_init_copy mp_init_copy
#define TclBN_mp_init_multi mp_init_multi
#define TclBN_mp_init_size mp_init_size
-#define TclBN_mp_init_l mp_init_l
#define TclBN_mp_init_i64 mp_init_i64
#define TclBN_mp_init_u64 mp_init_u64
-#define TclBN_mp_init_ul mp_init_ul
#define TclBN_mp_lshd mp_lshd
#define TclBN_mp_mod mp_mod
#define TclBN_mp_mod_2d mp_mod_2d
@@ -101,7 +98,6 @@
#define TclBN_mp_reverse mp_reverse
#define TclBN_mp_read_radix mp_read_radix
#define TclBN_mp_rshd mp_rshd
-#define TclBN_mp_set_l mp_set_l
#define TclBN_mp_set_i64 mp_set_i64
#define TclBN_mp_set_u64 mp_set_u64
#define TclBN_mp_shrink mp_shrink
@@ -147,13 +143,13 @@ static int TclSockMinimumBuffersOld(int sock, int size)
mp_err TclBN_mp_set_int(mp_int *a, unsigned long i)
{
- mp_set_ul(a, i);
+ mp_set_u64(a, i);
return MP_OKAY;
}
static mp_err TclBN_mp_set_long(mp_int *a, unsigned long i)
{
- mp_set_ul(a, i);
+ mp_set_u64(a, i);
return MP_OKAY;
}
@@ -198,11 +194,6 @@ mp_err TclBN_mp_init_set(mp_int *a, unsigned int b) {
mp_err TclBN_mp_mul_d(const mp_int *a, unsigned int b, mp_int *c) {
return mp_mul_d(a, b, c);
}
-void TclBN_mp_set(mp_int *a, unsigned int b) {
- mp_set(a, b);
-}
-
-
#if defined(TCL_NO_DEPRECATED) || TCL_MAJOR_VERSION > 8
# define TclBN_mp_expt_d_ex 0
@@ -210,9 +201,13 @@ void TclBN_mp_set(mp_int *a, unsigned int b) {
# define TclBN_mp_to_unsigned_bin_n 0
# undef TclBN_mp_toradix_n
# define TclBN_mp_toradix_n 0
+# undef TclBN_mp_sqr
# define TclBN_mp_sqr 0
# undef TclBN_mp_div_3
# define TclBN_mp_div_3 0
+# define TclBN_mp_init_l 0
+# define TclBN_mp_init_ul 0
+# define TclBN_mp_set 0
# define TclSetStartupScriptPath 0
# define TclGetStartupScriptPath 0
# define TclSetStartupScriptFileName 0
@@ -278,6 +273,20 @@ void TclBN_reverse(unsigned char *s, int len)
}
}
+mp_err TclBN_mp_init_ul(mp_int *a, unsigned long b)
+{
+ return TclBN_mp_init_u64(a,b);
+}
+
+mp_err TclBN_mp_init_l(mp_int *a, long b)
+{
+ return TclBN_mp_init_i64(a,b);
+}
+
+void TclBN_mp_set(mp_int *a, unsigned int b) {
+ mp_set_u64(a, b);
+}
+
mp_err TclBN_mp_toradix_n(const mp_int *a, char *str, int radix, int maxlen)
{
if (maxlen < 0) {
@@ -1129,8 +1138,8 @@ const TclTomMathStubs tclTomMathStubs = {
TclBN_mp_set_u64, /* 68 */
TclBN_mp_get_mag_u64, /* 69 */
TclBN_mp_set_i64, /* 70 */
- TclBN_mp_get_mag_ul, /* 71 */
- TclBN_mp_set_l, /* 72 */
+ 0, /* 71 */
+ 0, /* 72 */
TclBN_mp_tc_and, /* 73 */
TclBN_mp_tc_or, /* 74 */
TclBN_mp_tc_xor, /* 75 */
diff --git a/generic/tclTomMath.decls b/generic/tclTomMath.decls
index 45579f4..e059ba0 100644
--- a/generic/tclTomMath.decls
+++ b/generic/tclTomMath.decls
@@ -75,7 +75,7 @@ declare 16 {
mp_err MP_WUR TclBN_mp_div_2d(const mp_int *a, int b, mp_int *q, mp_int *r)
}
declare 17 {deprecated {is private function in libtommath}} {
- mp_err MP_WUR TclBN_mp_div_3(const mp_int *a, mp_int *q, unsigned int *r)
+ mp_err TclBN_mp_div_3(const mp_int *a, mp_int *q, unsigned int *r)
}
declare 18 {
void TclBN_mp_exch(mp_int *a, mp_int *b)
@@ -140,11 +140,11 @@ declare 37 {
declare 38 {
mp_err MP_WUR TclBN_mp_shrink(mp_int *a)
}
-declare 39 {
+declare 39 {deprecated {macro calling mp_set_u64}} {
void TclBN_mp_set(mp_int *a, unsigned int b)
}
-declare 40 {nostub {is private function in libtommath}} {
- mp_err MP_WUR TclBN_mp_sqr(const mp_int *a, mp_int *b)
+declare 40 {deprecated {is private function in libtommath}} {
+ mp_err TclBN_mp_sqr(const mp_int *a, mp_int *b)
}
declare 41 {
mp_err MP_WUR TclBN_mp_sqrt(const mp_int *a, mp_int *b)
@@ -211,17 +211,17 @@ declare 59 {deprecated {is private function in libtommath}} {
declare 60 {deprecated {is private function in libtommath}} {
mp_err TclBN_s_mp_sub(const mp_int *a, const mp_int *b, mp_int *c)
}
-declare 61 {
- mp_err MP_WUR TclBN_mp_init_ul(mp_int *a, unsigned long i)
+declare 61 {deprecated {macro calling mp_init_u64}} {
+ mp_err TclBN_mp_init_ul(mp_int *a, unsigned long i)
}
-declare 62 {
+declare 62 {deprecated {macro calling mp_set_u64}} {
void TclBN_mp_set_ul(mp_int *a, unsigned long i)
}
declare 63 {
int MP_WUR TclBN_mp_cnt_lsb(const mp_int *a)
}
-declare 64 {
- int MP_WUR TclBN_mp_init_l(mp_int *bignum, long initVal)
+declare 64 {deprecated {macro calling mp_init_i64}} {
+ int TclBN_mp_init_l(mp_int *bignum, long initVal)
}
declare 65 {
int MP_WUR TclBN_mp_init_i64(mp_int *bignum, int64_t initVal)
@@ -244,22 +244,16 @@ declare 69 {
declare 70 {
void TclBN_mp_set_i64(mp_int *a, int64_t i)
}
-declare 71 {
- unsigned long MP_WUR TclBN_mp_get_mag_ul(const mp_int *a)
-}
-declare 72 {
- void TclBN_mp_set_l(mp_int *a, long i)
-}
# Added in libtommath 1.1.0
-declare 73 {
- mp_err MP_WUR TclBN_mp_tc_and(const mp_int *a, const mp_int *b, mp_int *c)
+declare 73 {deprecated {merged with mp_and}} {
+ mp_err TclBN_mp_tc_and(const mp_int *a, const mp_int *b, mp_int *c)
}
-declare 74 {
- mp_err MP_WUR TclBN_mp_tc_or(const mp_int *a, const mp_int *b, mp_int *c)
+declare 74 {deprecated {merged with mp_or}} {
+ mp_err TclBN_mp_tc_or(const mp_int *a, const mp_int *b, mp_int *c)
}
-declare 75 {
- mp_err MP_WUR TclBN_mp_tc_xor(const mp_int *a, const mp_int *b, mp_int *c)
+declare 75 {deprecated {merged with mp_xor}} {
+ mp_err TclBN_mp_tc_xor(const mp_int *a, const mp_int *b, mp_int *c)
}
declare 76 {
mp_err MP_WUR TclBN_mp_signed_rsh(const mp_int *a, int b, mp_int *c)
diff --git a/generic/tclTomMath.h b/generic/tclTomMath.h
index caa2f05..4c80770 100644
--- a/generic/tclTomMath.h
+++ b/generic/tclTomMath.h
@@ -11,8 +11,4 @@
#include <tommath.h>
#include "tclTomMathDecls.h"
-#undef mp_iseven
-#undef mp_isodd
-#define mp_iseven(a) (!mp_isodd(a))
-#define mp_isodd(a) (((a)->used != 0 && (((a)->dp[0] & 1) != 0)) ? MP_YES : MP_NO)
#endif
diff --git a/generic/tclTomMathDecls.h b/generic/tclTomMathDecls.h
index 159cf8f..34e0ec1 100644
--- a/generic/tclTomMathDecls.h
+++ b/generic/tclTomMathDecls.h
@@ -89,16 +89,13 @@ MODULE_SCOPE mp_err TclBN_s_mp_expt_u32(const mp_int *a, unsigned int b, mp_int
#define mp_expt_d_ex TclBN_mp_expt_d_ex
#define mp_get_bit TclBN_mp_get_bit
#define mp_get_mag_u64 TclBN_mp_get_mag_u64
-#define mp_get_mag_ul TclBN_mp_get_mag_ul
#define mp_grow TclBN_mp_grow
#define mp_init TclBN_mp_init
#define mp_init_copy TclBN_mp_init_copy
#define mp_init_i64 TclBN_mp_init_i64
-#define mp_init_l TclBN_mp_init_l
#define mp_init_multi TclBN_mp_init_multi
#define mp_init_size TclBN_mp_init_size
#define mp_init_u64 TclBN_mp_init_u64
-#define mp_init_ul TclBN_mp_init_ul
#define mp_lshd TclBN_mp_lshd
#define mp_mod TclBN_mp_mod
#define mp_mod_2d TclBN_mp_mod_2d
@@ -110,10 +107,7 @@ MODULE_SCOPE mp_err TclBN_s_mp_expt_u32(const mp_int *a, unsigned int b, mp_int
#define mp_radix_size TclBN_mp_radix_size
#define mp_read_radix TclBN_mp_read_radix
#define mp_rshd TclBN_mp_rshd
-#define mp_set_l TclBN_mp_set_l
#define mp_set_i64 TclBN_mp_set_i64
-#define mp_set_ul TclBN_mp_set_ul
-#define mp_set_ull TclBN_mp_set_ull
#define mp_shrink TclBN_mp_shrink
#define mp_sqrt TclBN_mp_sqrt
#define mp_sub TclBN_mp_sub
@@ -145,10 +139,10 @@ MODULE_SCOPE mp_err TclBN_s_mp_expt_u32(const mp_int *a, unsigned int b, mp_int
#define s_mp_toom_sqr TclBN_mp_toom_sqr
#endif /* !TCL_WITH_EXTERNAL_TOMMATH */
-#define mp_init_set_int(a,i) (MP_DEPRECATED_PRAGMA("replaced by mp_init_ul") TclBN_mp_init_ul(a,(unsigned int)(i)))
-#define mp_set_int(a,b) (MP_DEPRECATED_PRAGMA("replaced by mp_set_ul") (TclBN_mp_set_ul((a),((unsigned int)(b))),MP_OKAY))
-#define mp_set_long(a,b) (MP_DEPRECATED_PRAGMA("replaced by mp_set_ul") (TclBN_mp_set_ul((a),(b)),MP_OKAY))
-#define mp_set_long_long(a,b) (MP_DEPRECATED_PRAGMA("replaced by mp_set_u64") (TclBN_mp_set_ull((a),(b)),MP_OKAY))
+#define mp_init_set_int(a,b) (MP_DEPRECATED_PRAGMA("replaced by mp_init_ul") TclBN_mp_init_u64(a,(unsigned int)(b)))
+#define mp_set_int(a,b) (MP_DEPRECATED_PRAGMA("replaced by mp_set_ul") (TclBN_mp_set_u64((a),((unsigned int)(b))),MP_OKAY))
+#define mp_set_long(a,b) (MP_DEPRECATED_PRAGMA("replaced by mp_set_ul") (TclBN_mp_set_u64((a),(long)(b)),MP_OKAY))
+#define mp_set_long_long(a,b) (MP_DEPRECATED_PRAGMA("replaced by mp_set_ull") (TclBN_mp_set_u64((a),(b)),MP_OKAY))
#define mp_unsigned_bin_size(mp) (MP_DEPRECATED_PRAGMA("replaced by mp_ubin_size") (int)TclBN_mp_ubin_size(mp))
#undef TCL_STORAGE_CLASS
@@ -220,8 +214,8 @@ EXTERN mp_err TclBN_mp_div_2d(const mp_int *a, int b, mp_int *q,
mp_int *r) MP_WUR;
/* 17 */
TCL_DEPRECATED("is private function in libtommath")
-mp_err MP_WUR TclBN_mp_div_3(const mp_int *a, mp_int *q,
- unsigned int *r) MP_WUR;
+mp_err TclBN_mp_div_3(const mp_int *a, mp_int *q,
+ unsigned int *r);
/* 18 */
EXTERN void TclBN_mp_exch(mp_int *a, mp_int *b);
/* 19 */
@@ -272,9 +266,11 @@ EXTERN void TclBN_mp_rshd(mp_int *a, int shift);
/* 38 */
EXTERN mp_err TclBN_mp_shrink(mp_int *a) MP_WUR;
/* 39 */
-EXTERN void TclBN_mp_set(mp_int *a, unsigned int b);
+TCL_DEPRECATED("macro calling mp_set_u64")
+void TclBN_mp_set(mp_int *a, unsigned int b);
/* 40 */
-EXTERN mp_err TclBN_mp_sqr(const mp_int *a, mp_int *b) MP_WUR;
+TCL_DEPRECATED("is private function in libtommath")
+mp_err TclBN_mp_sqr(const mp_int *a, mp_int *b);
/* 41 */
EXTERN mp_err TclBN_mp_sqrt(const mp_int *a, mp_int *b) MP_WUR;
/* 42 */
@@ -342,13 +338,16 @@ TCL_DEPRECATED("is private function in libtommath")
mp_err TclBN_s_mp_sub(const mp_int *a, const mp_int *b,
mp_int *c);
/* 61 */
-EXTERN mp_err TclBN_mp_init_ul(mp_int *a, unsigned long i) MP_WUR;
+TCL_DEPRECATED("macro calling mp_init_u64")
+mp_err TclBN_mp_init_ul(mp_int *a, unsigned long i);
/* 62 */
-EXTERN void TclBN_mp_set_ul(mp_int *a, unsigned long i);
+TCL_DEPRECATED("macro calling mp_set_u64")
+void TclBN_mp_set_ul(mp_int *a, unsigned long i);
/* 63 */
EXTERN int TclBN_mp_cnt_lsb(const mp_int *a) MP_WUR;
/* 64 */
-EXTERN int TclBN_mp_init_l(mp_int *bignum, long initVal) MP_WUR;
+TCL_DEPRECATED("macro calling mp_init_i64")
+int TclBN_mp_init_l(mp_int *bignum, long initVal);
/* 65 */
EXTERN int TclBN_mp_init_i64(mp_int *bignum, int64_t initVal) MP_WUR;
/* 66 */
@@ -363,19 +362,20 @@ EXTERN void TclBN_mp_set_u64(mp_int *a, uint64_t i);
EXTERN uint64_t TclBN_mp_get_mag_u64(const mp_int *a) MP_WUR;
/* 70 */
EXTERN void TclBN_mp_set_i64(mp_int *a, int64_t i);
-/* 71 */
-EXTERN unsigned long TclBN_mp_get_mag_ul(const mp_int *a) MP_WUR;
-/* 72 */
-EXTERN void TclBN_mp_set_l(mp_int *a, long i);
+/* Slot 71 is reserved */
+/* Slot 72 is reserved */
/* 73 */
-EXTERN mp_err TclBN_mp_tc_and(const mp_int *a, const mp_int *b,
- mp_int *c) MP_WUR;
+TCL_DEPRECATED("merged with mp_and")
+mp_err TclBN_mp_tc_and(const mp_int *a, const mp_int *b,
+ mp_int *c);
/* 74 */
-EXTERN mp_err TclBN_mp_tc_or(const mp_int *a, const mp_int *b,
- mp_int *c) MP_WUR;
+TCL_DEPRECATED("merged with mp_or")
+mp_err TclBN_mp_tc_or(const mp_int *a, const mp_int *b,
+ mp_int *c);
/* 75 */
-EXTERN mp_err TclBN_mp_tc_xor(const mp_int *a, const mp_int *b,
- mp_int *c) MP_WUR;
+TCL_DEPRECATED("merged with mp_xor")
+mp_err TclBN_mp_tc_xor(const mp_int *a, const mp_int *b,
+ mp_int *c);
/* 76 */
EXTERN mp_err TclBN_mp_signed_rsh(const mp_int *a, int b,
mp_int *c) MP_WUR;
@@ -413,7 +413,7 @@ typedef struct TclTomMathStubs {
mp_err (*tclBN_mp_div_d) (const mp_int *a, unsigned int b, mp_int *q, unsigned int *r) MP_WUR; /* 14 */
mp_err (*tclBN_mp_div_2) (const mp_int *a, mp_int *q) MP_WUR; /* 15 */
mp_err (*tclBN_mp_div_2d) (const mp_int *a, int b, mp_int *q, mp_int *r) MP_WUR; /* 16 */
- TCL_DEPRECATED_API("is private function in libtommath") mp_err (*tclBN_mp_div_3) (const mp_int *a, mp_int *q, unsigned int *r) MP_WUR; /* 17 */
+ TCL_DEPRECATED_API("is private function in libtommath") mp_err (*tclBN_mp_div_3) (const mp_int *a, mp_int *q, unsigned int *r); /* 17 */
void (*tclBN_mp_exch) (mp_int *a, mp_int *b); /* 18 */
mp_err (*tclBN_mp_expt_u32) (const mp_int *a, unsigned int b, mp_int *c) MP_WUR; /* 19 */
mp_err (*tclBN_mp_grow) (mp_int *a, int size) MP_WUR; /* 20 */
@@ -435,8 +435,8 @@ typedef struct TclTomMathStubs {
mp_err (*tclBN_mp_read_radix) (mp_int *a, const char *str, int radix) MP_WUR; /* 36 */
void (*tclBN_mp_rshd) (mp_int *a, int shift); /* 37 */
mp_err (*tclBN_mp_shrink) (mp_int *a) MP_WUR; /* 38 */
- void (*tclBN_mp_set) (mp_int *a, unsigned int b); /* 39 */
- TCL_DEPRECATED_API("is private function in libtommath") mp_err (*tclBN_mp_sqr) (const mp_int *a, mp_int *b) MP_WUR; /* 40 */
+ TCL_DEPRECATED_API("macro calling mp_set_u64") void (*tclBN_mp_set) (mp_int *a, unsigned int b); /* 39 */
+ TCL_DEPRECATED_API("is private function in libtommath") mp_err (*tclBN_mp_sqr) (const mp_int *a, mp_int *b); /* 40 */
mp_err (*tclBN_mp_sqrt) (const mp_int *a, mp_int *b) MP_WUR; /* 41 */
mp_err (*tclBN_mp_sub) (const mp_int *a, const mp_int *b, mp_int *c) MP_WUR; /* 42 */
mp_err (*tclBN_mp_sub_d) (const mp_int *a, unsigned int b, mp_int *c) MP_WUR; /* 43 */
@@ -457,21 +457,21 @@ typedef struct TclTomMathStubs {
TCL_DEPRECATED_API("is private function in libtommath") mp_err (*tclBN_s_mp_mul_digs) (const mp_int *a, const mp_int *b, mp_int *c, int digs); /* 58 */
TCL_DEPRECATED_API("is private function in libtommath") mp_err (*tclBN_s_mp_sqr) (const mp_int *a, mp_int *b); /* 59 */
TCL_DEPRECATED_API("is private function in libtommath") mp_err (*tclBN_s_mp_sub) (const mp_int *a, const mp_int *b, mp_int *c); /* 60 */
- mp_err (*tclBN_mp_init_ul) (mp_int *a, unsigned long i) MP_WUR; /* 61 */
- void (*tclBN_mp_set_ul) (mp_int *a, unsigned long i); /* 62 */
+ TCL_DEPRECATED_API("macro calling mp_init_u64") mp_err (*tclBN_mp_init_ul) (mp_int *a, unsigned long i); /* 61 */
+ TCL_DEPRECATED_API("macro calling mp_set_u64") void (*tclBN_mp_set_ul) (mp_int *a, unsigned long i); /* 62 */
int (*tclBN_mp_cnt_lsb) (const mp_int *a) MP_WUR; /* 63 */
- int (*tclBN_mp_init_l) (mp_int *bignum, long initVal) MP_WUR; /* 64 */
+ TCL_DEPRECATED_API("macro calling mp_init_i64") int (*tclBN_mp_init_l) (mp_int *bignum, long initVal); /* 64 */
int (*tclBN_mp_init_i64) (mp_int *bignum, int64_t initVal) MP_WUR; /* 65 */
int (*tclBN_mp_init_u64) (mp_int *bignum, uint64_t initVal) MP_WUR; /* 66 */
TCL_DEPRECATED_API("Use mp_expt_u32") mp_err (*tclBN_mp_expt_d_ex) (const mp_int *a, unsigned int b, mp_int *c, int fast); /* 67 */
void (*tclBN_mp_set_u64) (mp_int *a, uint64_t i); /* 68 */
uint64_t (*tclBN_mp_get_mag_u64) (const mp_int *a) MP_WUR; /* 69 */
void (*tclBN_mp_set_i64) (mp_int *a, int64_t i); /* 70 */
- unsigned long (*tclBN_mp_get_mag_ul) (const mp_int *a) MP_WUR; /* 71 */
- void (*tclBN_mp_set_l) (mp_int *a, long i); /* 72 */
- mp_err (*tclBN_mp_tc_and) (const mp_int *a, const mp_int *b, mp_int *c) MP_WUR; /* 73 */
- mp_err (*tclBN_mp_tc_or) (const mp_int *a, const mp_int *b, mp_int *c) MP_WUR; /* 74 */
- mp_err (*tclBN_mp_tc_xor) (const mp_int *a, const mp_int *b, mp_int *c) MP_WUR; /* 75 */
+ void (*reserved71)(void);
+ void (*reserved72)(void);
+ TCL_DEPRECATED_API("merged with mp_and") mp_err (*tclBN_mp_tc_and) (const mp_int *a, const mp_int *b, mp_int *c); /* 73 */
+ TCL_DEPRECATED_API("merged with mp_or") mp_err (*tclBN_mp_tc_or) (const mp_int *a, const mp_int *b, mp_int *c); /* 74 */
+ TCL_DEPRECATED_API("merged with mp_xor") mp_err (*tclBN_mp_tc_xor) (const mp_int *a, const mp_int *b, mp_int *c); /* 75 */
mp_err (*tclBN_mp_signed_rsh) (const mp_int *a, int b, mp_int *c) MP_WUR; /* 76 */
TCL_DEPRECATED_API("is private function in libtommath") mp_bool (*tclBN_mp_get_bit) (const mp_int *a, unsigned int b); /* 77 */
int (*tclBN_mp_to_ubin) (const mp_int *a, unsigned char *buf, size_t maxlen, size_t *written) MP_WUR; /* 78 */
@@ -633,10 +633,8 @@ extern const TclTomMathStubs *tclTomMathStubsPtr;
(tclTomMathStubsPtr->tclBN_mp_get_mag_u64) /* 69 */
#define TclBN_mp_set_i64 \
(tclTomMathStubsPtr->tclBN_mp_set_i64) /* 70 */
-#define TclBN_mp_get_mag_ul \
- (tclTomMathStubsPtr->tclBN_mp_get_mag_ul) /* 71 */
-#define TclBN_mp_set_l \
- (tclTomMathStubsPtr->tclBN_mp_set_l) /* 72 */
+/* Slot 71 is reserved */
+/* Slot 72 is reserved */
#define TclBN_mp_tc_and \
(tclTomMathStubsPtr->tclBN_mp_tc_and) /* 73 */
#define TclBN_mp_tc_or \
@@ -676,7 +674,7 @@ extern const TclTomMathStubs *tclTomMathStubsPtr;
#define TclBNInitBignumFromLong(a,b) \
do { \
(a)->dp = NULL; \
- (void)mp_init_l((a),(b)); \
+ (void)mp_init_i64((a),(b)); \
if ((a)->dp == NULL) { \
Tcl_Panic("initialization failure in TclBNInitBignumFromLong"); \
} \
@@ -699,11 +697,32 @@ extern const TclTomMathStubs *tclTomMathStubsPtr;
Tcl_Panic("initialization failure in TclBNInitBignumFromWideUInt"); \
} \
} while (0)
-#define mp_init_i32(a,b) mp_init_l((a),(int32_t)(b))
-#define mp_init_ll(a,b) mp_init_i64((a),(b))
+#undef mp_get_ll
+#define mp_get_ll(a) ((long long)mp_get_i64(a))
+#undef mp_set_ll
+#define mp_set_ll(a,b) mp_set_i64(a,b)
+#undef mp_init_ll
+#define mp_init_ll(a,b) mp_init_i64(a,b)
+#undef mp_get_ull
+#define mp_get_ull(a) ((unsigned long long)mp_get_i64(a))
+#undef mp_set_ull
+#define mp_set_ull(a,b) mp_set_u64(a,b)
+#undef mp_init_ull
+#define mp_init_ull(a,b) mp_init_u64(a,b)
+#undef mp_set
+#define mp_set(a,b) mp_set_i64((a),(int32_t)(b))
+#define mp_set_i32(a,b) mp_set_i64((a),(int32_t)(b))
+#define mp_set_l(a,b) mp_set_i64((a),(long)(b))
+#define mp_set_u32(a,b) mp_set_u64((a),(uint32_t)(b))
+#define mp_set_ul(a,b) mp_set_u64((a),(unsigned long)(b))
+#define mp_init_i32(a,b) mp_init_i64((a),(int32_t)(b))
+#define mp_init_l(a,b) mp_init_i64((a),(long)(b))
#define mp_init_u32(a,b) mp_init_u64((a),(uint32_t)(b))
-#define mp_init_ull(a,b) mp_init_u64((a),(b))
-
+#define mp_init_ul(a,b) mp_init_u64((a),(unsigned long)(b))
+#undef mp_iseven
+#undef mp_isodd
+#define mp_iseven(a) (!mp_isodd(a))
+#define mp_isodd(a) (((a)->used != 0 && (((a)->dp[0] & 1) != 0)) ? MP_YES : MP_NO)
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT
diff --git a/libtommath/tommath.h b/libtommath/tommath.h
index 7bb89e5..24dab35 100644
--- a/libtommath/tommath.h
+++ b/libtommath/tommath.h
@@ -32,7 +32,7 @@ extern "C" {
#endif
/* MS Visual C++ doesn't have a 128bit type for words, so fall back to 32bit MPI's (where words are 64bit) */
-#if (defined(_MSC_VER) || defined(__LLP64__) || defined(__e2k__) || defined(__LCC__)) && !defined(MP_64BIT)
+#if (defined(_MSC_VER) || defined(__LLP64__) || defined(__e2k__) || defined(__LCC__)) && !defined(MP_32BIT) && !defined(MP_64BIT)
# define MP_32BIT
#endif
@@ -331,7 +331,11 @@ mp_err mp_init_u64(mp_int *a, uint64_t b) MP_WUR;
uint32_t mp_get_mag_u32(const mp_int *a) MP_WUR;
uint64_t mp_get_mag_u64(const mp_int *a) MP_WUR;
unsigned long mp_get_mag_ul(const mp_int *a) MP_WUR;
+#ifdef _MSC_VER
+#define mp_get_mag_ull(a) ((unsigned long long)mp_get_mag_u64(a))
+#else
unsigned long long mp_get_mag_ull(const mp_int *a) MP_WUR;
+#endif
/* get integer, set integer (long) */
long mp_get_l(const mp_int *a) MP_WUR;
@@ -343,6 +347,17 @@ mp_err mp_init_l(mp_int *a, long b) MP_WUR;
void mp_set_ul(mp_int *a, unsigned long b);
mp_err mp_init_ul(mp_int *a, unsigned long b) MP_WUR;
+#ifdef _MSC_VER
+/* get integer, set integer (long long) */
+#define mp_get_ll(a) ((long long)mp_get_i64(a))
+#define mp_set_ll(a,b) mp_set_i64(a,b)
+#define mp_init_ll(a,b) mp_init_i64(a,b)
+
+/* get integer, set integer (unsigned long long) */
+#define mp_get_ull(a) ((unsigned long long)mp_get_i64(a))
+#define mp_set_ull(a,b) mp_set_u64(a,b)
+#define mp_init_ull(a,b) mp_init_u64(a,b)
+#else
/* get integer, set integer (long long) */
long long mp_get_ll(const mp_int *a) MP_WUR;
void mp_set_ll(mp_int *a, long long b);
@@ -352,6 +367,7 @@ mp_err mp_init_ll(mp_int *a, long long b) MP_WUR;
#define mp_get_ull(a) ((unsigned long long)mp_get_ll(a))
void mp_set_ull(mp_int *a, unsigned long long b);
mp_err mp_init_ull(mp_int *a, unsigned long long b) MP_WUR;
+#endif
/* set to single unsigned digit, up to MP_DIGIT_MAX */
void mp_set(mp_int *a, mp_digit b);
@@ -360,10 +376,14 @@ mp_err mp_init_set(mp_int *a, mp_digit b) MP_WUR;
/* get integer, set integer and init with integer (deprecated) */
MP_DEPRECATED(mp_get_mag_u32/mp_get_u32) unsigned long mp_get_int(const mp_int *a) MP_WUR;
MP_DEPRECATED(mp_get_mag_ul/mp_get_ul) unsigned long mp_get_long(const mp_int *a) MP_WUR;
+#ifdef _MSC_VER
MP_DEPRECATED(mp_get_mag_ull/mp_get_ull) unsigned long long mp_get_long_long(const mp_int *a) MP_WUR;
+#endif
MP_DEPRECATED(mp_set_ul) mp_err mp_set_int(mp_int *a, unsigned long b);
MP_DEPRECATED(mp_set_ul) mp_err mp_set_long(mp_int *a, unsigned long b);
+#ifdef _MSC_VER
MP_DEPRECATED(mp_set_ull) mp_err mp_set_long_long(mp_int *a, unsigned long long b);
+#endif
MP_DEPRECATED(mp_init_ul) mp_err mp_init_set_int(mp_int *a, unsigned long b) MP_WUR;
/* copy, b = a */
diff --git a/unix/Makefile.in b/unix/Makefile.in
index dcb471e..72dd6d9 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -329,17 +329,17 @@ TOMMATH_OBJS = bn_s_mp_reverse.o bn_s_mp_mul_digs_fast.o \
bn_mp_cnt_lsb.o bn_mp_copy.o \
bn_mp_count_bits.o bn_mp_div.o bn_mp_div_d.o bn_mp_div_2.o \
bn_mp_div_2d.o bn_mp_div_3.o bn_mp_exch.o bn_mp_expt_u32.o \
- bn_s_mp_get_bit.o bn_mp_get_mag_u64.o bn_mp_get_mag_ul.o \
+ bn_s_mp_get_bit.o bn_mp_get_mag_u64.o \
bn_mp_grow.o bn_mp_init.o \
bn_mp_init_copy.o bn_mp_init_multi.o bn_mp_init_set.o \
- bn_mp_init_size.o bn_mp_init_ul.o bn_s_mp_karatsuba_mul.o \
- bn_mp_init_l.o bn_mp_init_i64.o bn_mp_init_u64.o \
+ bn_mp_init_size.o bn_s_mp_karatsuba_mul.o \
+ bn_mp_init_i64.o bn_mp_init_u64.o \
bn_s_mp_karatsuba_sqr.o bn_s_mp_balance_mul.o \
bn_mp_lshd.o bn_mp_mod.o bn_mp_mod_2d.o bn_mp_mul.o bn_mp_mul_2.o \
bn_mp_mul_2d.o bn_mp_mul_d.o bn_mp_neg.o bn_mp_or.o \
bn_mp_radix_size.o bn_mp_radix_smap.o bn_mp_set_i64.o \
- bn_mp_read_radix.o bn_mp_rshd.o bn_mp_set.o bn_mp_set_l.o \
- bn_mp_set_u64.o bn_mp_set_ul.o bn_mp_shrink.o \
+ bn_mp_read_radix.o bn_mp_rshd.o \
+ bn_mp_set_u64.o bn_mp_shrink.o \
bn_mp_sqr.o bn_mp_sqrt.o bn_mp_sub.o bn_mp_sub_d.o \
bn_mp_signed_rsh.o \
bn_mp_to_ubin.o \
@@ -1619,9 +1619,6 @@ bn_s_mp_get_bit.o: $(TOMMATH_DIR)/bn_s_mp_get_bit.c $(MATHHDRS)
bn_mp_get_mag_u64.o: $(TOMMATH_DIR)/bn_mp_get_mag_u64.c $(MATHHDRS)
$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_get_mag_u64.c
-bn_mp_get_mag_ul.o: $(TOMMATH_DIR)/bn_mp_get_mag_ul.c $(MATHHDRS)
- $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_get_mag_ul.c
-
bn_mp_grow.o: $(TOMMATH_DIR)/bn_mp_grow.c $(MATHHDRS)
$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_grow.c
@@ -1634,9 +1631,6 @@ bn_mp_init_copy.o: $(TOMMATH_DIR)/bn_mp_init_copy.c $(MATHHDRS)
bn_mp_init_i64.o:$(TOMMATH_DIR)/bn_mp_init_i64.c $(MATHHDRS)
$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_init_i64.c
-bn_mp_init_l.o:$(TOMMATH_DIR)/bn_mp_init_l.c $(MATHHDRS)
- $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_init_l.c
-
bn_mp_init_multi.o: $(TOMMATH_DIR)/bn_mp_init_multi.c $(MATHHDRS)
$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_init_multi.c
@@ -1649,9 +1643,6 @@ bn_mp_init_size.o:$(TOMMATH_DIR)/bn_mp_init_size.c $(MATHHDRS)
bn_mp_init_u64.o:$(TOMMATH_DIR)/bn_mp_init_u64.c $(MATHHDRS)
$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_init_u64.c
-bn_mp_init_ul.o:$(TOMMATH_DIR)/bn_mp_init_ul.c $(MATHHDRS)
- $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_init_ul.c
-
bn_s_mp_karatsuba_mul.o: $(TOMMATH_DIR)/bn_s_mp_karatsuba_mul.c $(MATHHDRS)
$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_s_mp_karatsuba_mul.c
@@ -1700,21 +1691,12 @@ bn_mp_read_radix.o: $(TOMMATH_DIR)/bn_mp_read_radix.c $(MATHHDRS)
bn_mp_rshd.o: $(TOMMATH_DIR)/bn_mp_rshd.c $(MATHHDRS)
$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_rshd.c
-bn_mp_set.o: $(TOMMATH_DIR)/bn_mp_set.c $(MATHHDRS)
- $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_set.c
-
bn_mp_set_i64.o: $(TOMMATH_DIR)/bn_mp_set_i64.c $(MATHHDRS)
$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_set_i64.c
-bn_mp_set_l.o: $(TOMMATH_DIR)/bn_mp_set_l.c $(MATHHDRS)
- $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_set_l.c
-
bn_mp_set_u64.o: $(TOMMATH_DIR)/bn_mp_set_u64.c $(MATHHDRS)
$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_set_u64.c
-bn_mp_set_ul.o: $(TOMMATH_DIR)/bn_mp_set_ul.c $(MATHHDRS)
- $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_set_ul.c
-
bn_mp_shrink.o: $(TOMMATH_DIR)/bn_mp_shrink.c $(MATHHDRS)
$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_shrink.c
diff --git a/win/Makefile.in b/win/Makefile.in
index 3a179b4..8057683 100644
--- a/win/Makefile.in
+++ b/win/Makefile.in
@@ -380,17 +380,14 @@ TOMMATH_OBJS = \
bn_mp_exch.${OBJEXT} \
bn_mp_expt_u32.${OBJEXT} \
bn_mp_get_mag_u64.${OBJEXT} \
- bn_mp_get_mag_ul.${OBJEXT} \
bn_mp_grow.${OBJEXT} \
bn_mp_init.${OBJEXT} \
bn_mp_init_copy.${OBJEXT} \
bn_mp_init_i64.${OBJEXT} \
- bn_mp_init_l.${OBJEXT} \
bn_mp_init_multi.${OBJEXT} \
bn_mp_init_set.${OBJEXT} \
bn_mp_init_size.${OBJEXT} \
bn_mp_init_u64.${OBJEXT} \
- bn_mp_init_ul.${OBJEXT} \
bn_mp_lshd.${OBJEXT} \
bn_mp_mod.${OBJEXT} \
bn_mp_mod_2d.${OBJEXT} \
@@ -404,11 +401,8 @@ TOMMATH_OBJS = \
bn_mp_radix_smap.${OBJEXT} \
bn_mp_read_radix.${OBJEXT} \
bn_mp_rshd.${OBJEXT} \
- bn_mp_set.${OBJEXT} \
bn_mp_set_i64.${OBJEXT} \
- bn_mp_set_l.${OBJEXT} \
bn_mp_set_u64.${OBJEXT} \
- bn_mp_set_ul.${OBJEXT} \
bn_mp_shrink.${OBJEXT} \
bn_mp_sqr.${OBJEXT} \
bn_mp_sqrt.${OBJEXT} \
@@ -914,6 +908,7 @@ install-headers:
$(GENERIC_DIR)/tclPlatDecls.h \
$(GENERIC_DIR)/tclTomMath.h \
$(GENERIC_DIR)/tclTomMathDecls.h ; \
+ $(TOMMATH_DIR)/tommath.h ; \
do \
$(COPY) $$i "$(INCLUDE_INSTALL_DIR)"; \
done;
diff --git a/win/makefile.vc b/win/makefile.vc
index cd7e6ba..743487e 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -337,17 +337,14 @@ TOMMATHOBJS = \
$(TMP_DIR)\bn_mp_exch.obj \
$(TMP_DIR)\bn_mp_expt_u32.obj \
$(TMP_DIR)\bn_mp_get_mag_u64.obj \
- $(TMP_DIR)\bn_mp_get_mag_ul.obj \
$(TMP_DIR)\bn_mp_grow.obj \
$(TMP_DIR)\bn_mp_init.obj \
$(TMP_DIR)\bn_mp_init_copy.obj \
$(TMP_DIR)\bn_mp_init_i64.obj \
- $(TMP_DIR)\bn_mp_init_l.obj \
$(TMP_DIR)\bn_mp_init_multi.obj \
$(TMP_DIR)\bn_mp_init_set.obj \
$(TMP_DIR)\bn_mp_init_size.obj \
$(TMP_DIR)\bn_mp_init_u64.obj \
- $(TMP_DIR)\bn_mp_init_ul.obj \
$(TMP_DIR)\bn_mp_lshd.obj \
$(TMP_DIR)\bn_mp_mod.obj \
$(TMP_DIR)\bn_mp_mod_2d.obj \
@@ -361,11 +358,8 @@ TOMMATHOBJS = \
$(TMP_DIR)\bn_mp_radix_smap.obj \
$(TMP_DIR)\bn_mp_read_radix.obj \
$(TMP_DIR)\bn_mp_rshd.obj \
- $(TMP_DIR)\bn_mp_set.obj \
$(TMP_DIR)\bn_mp_set_i64.obj \
- $(TMP_DIR)\bn_mp_set_l.obj \
$(TMP_DIR)\bn_mp_set_u64.obj \
- $(TMP_DIR)\bn_mp_set_ul.obj \
$(TMP_DIR)\bn_mp_shrink.obj \
$(TMP_DIR)\bn_mp_sqr.obj \
$(TMP_DIR)\bn_mp_sqrt.obj \
@@ -892,8 +886,7 @@ install-libraries: tclConfig tcl-nmake install-msgs install-tzdata
@$(CPY) "$(GENERICDIR)\tclPlatDecls.h" "$(INCLUDE_INSTALL_DIR)\"
@$(CPY) "$(GENERICDIR)\tclTomMath.h" "$(INCLUDE_INSTALL_DIR)\"
@$(CPY) "$(GENERICDIR)\tclTomMathDecls.h" "$(INCLUDE_INSTALL_DIR)\"
- @$(CPY) "$(TOMMATHDIR)\tommath_class.h" "$(INCLUDE_INSTALL_DIR)\"
- @$(CPY) "$(TOMMATHDIR)\tommath_superclass.h" "$(INCLUDE_INSTALL_DIR)\"
+ @$(CPY) "$(TOMMATHDIR)\tommath.h" "$(INCLUDE_INSTALL_DIR)\"
@echo Installing library files to $(SCRIPT_INSTALL_DIR)
@$(CPY) "$(ROOT)\library\history.tcl" "$(SCRIPT_INSTALL_DIR)\"
@$(CPY) "$(ROOT)\library\init.tcl" "$(SCRIPT_INSTALL_DIR)\"
diff --git a/win/rules.vc b/win/rules.vc
index 2b11b01..cd3b035 100644
--- a/win/rules.vc
+++ b/win/rules.vc
@@ -1324,7 +1324,7 @@ OPTDEFINES = $(OPTDEFINES) /DTCL_UTF_MAX=6
!endif
# _ATL_XP_TARGETING - Newer SDK's need this to build for XP
-COMPILERFLAGS = /D_ATL_XP_TARGETING
+COMPILERFLAGS = /D_ATL_XP_TARGETING=1 /DMP_32BIT=1
# Like the TEA system only set this non empty for non-Tk extensions
# Note: some extensions use PACKAGE_NAME and others use PACKAGE_TCLNAME
diff --git a/win/tclWinPort.h b/win/tclWinPort.h
index 306e943..b43316a 100644
--- a/win/tclWinPort.h
+++ b/win/tclWinPort.h
@@ -19,6 +19,9 @@
/* See [Bug 3354324]: file mtime sets wrong time */
# define __MINGW_USE_VC2005_COMPAT
#endif
+#if defined(_MSC_VER) && defined(_WIN64) && !defined(MP_32BIT) && !defined(STATIC_BUILD)
+# define MP_64BIT
+#endif
/*
* We must specify the lower version we intend to support.
@@ -83,6 +86,9 @@ typedef DWORD_PTR * PDWORD_PTR;
#include <malloc.h>
#include <process.h>
#include <signal.h>
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
#include <limits.h>
#ifdef HAVE_STDINT_H
# include <stdint.h>