Posted to tcl by patthoyts at Fri Mar 03 15:52:35 GMT 2017view raw
- From 88fb09c19b7bfe98d4c711daf807623057c47a69 Mon Sep 17 00:00:00 2001
- From: Pat Thoyts <patthoyts@users.sourceforge.net>
- Date: Fri, 3 Mar 2017 15:50:11 +0000
- Subject: [PATCH] (review) use TCL_WIDE_INT_TYPE in the tcl libtommath headers
- This allows the use of Visual C++ 6 which does not define a "long long" type
- but can use __int64 instead.
- Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
- ---
- generic/tclTomMath.h | 10 +++++-----
- libtommath/tommath.h | 12 ++++++------
- 2 files changed, 11 insertions(+), 11 deletions(-)
- diff --git a/generic/tclTomMath.h b/generic/tclTomMath.h
- index 001019c5b..3f67b4aa4 100644
- --- a/generic/tclTomMath.h
- +++ b/generic/tclTomMath.h
- @@ -64,8 +64,8 @@ extern "C" {
- #elif defined(MP_64BIT)
- /* for GCC only on supported platforms */
- #ifndef CRYPT
- - typedef unsigned long long ulong64;
- - typedef signed long long long64;
- + typedef unsigned TCL_WIDE_INT_TYPE ulong64;
- + typedef signed TCL_WIDE_INT_TYPE long64;
- #endif
- #ifndef MP_DIGIT_DECLARED
- @@ -88,8 +88,8 @@ extern "C" {
- /* this is to make porting into LibTomCrypt easier :-) */
- #ifndef CRYPT
- - typedef unsigned long long ulong64;
- - typedef signed long long long64;
- + typedef unsigned TCL_WIDE_INT_TYPE ulong64;
- + typedef signed TCL_WIDE_INT_TYPE long64;
- #endif
- #ifndef MP_DIGIT_DECLARED
- @@ -278,7 +278,7 @@ unsigned long mp_get_int(mp_int * a);
- unsigned long mp_get_long(mp_int * a);
- /* get a platform dependent unsigned long long value */
- -unsigned long long mp_get_long_long(mp_int * a);
- +unsigned TCL_WIDE_INT_TYPE mp_get_long_long(mp_int * a);
- /* initialize and set a digit */
- /*
- diff --git a/libtommath/tommath.h b/libtommath/tommath.h
- index e69677989..299d36895 100644
- --- a/libtommath/tommath.h
- +++ b/libtommath/tommath.h
- @@ -58,8 +58,8 @@ extern "C" {
- #elif defined(MP_64BIT)
- /* for GCC only on supported platforms */
- #ifndef CRYPT
- - typedef unsigned long long ulong64;
- - typedef signed long long long64;
- + typedef unsigned TCL_WIDE_INT_TYPE ulong64;
- + typedef signed TCL_WIDE_INT_TYPE long64;
- #endif
- typedef ulong64 mp_digit;
- @@ -79,8 +79,8 @@ extern "C" {
- /* this is to make porting into LibTomCrypt easier :-) */
- #ifndef CRYPT
- - typedef unsigned long long ulong64;
- - typedef signed long long long64;
- + typedef unsigned TCL_WIDE_INT_TYPE ulong64;
- + typedef signed TCL_WIDE_INT_TYPE long64;
- #endif
- typedef uint32_t mp_digit;
- @@ -225,7 +225,7 @@ int mp_set_int(mp_int *a, unsigned long b);
- int mp_set_long(mp_int *a, unsigned long b);
- /* set a platform dependent unsigned long long value */
- -int mp_set_long_long(mp_int *a, unsigned long long b);
- +int mp_set_long_long(mp_int *a, unsigned TCL_WIDE_INT_TYPE b);
- /* get a 32-bit value */
- unsigned long mp_get_int(mp_int * a);
- @@ -234,7 +234,7 @@ unsigned long mp_get_int(mp_int * a);
- unsigned long mp_get_long(mp_int * a);
- /* get a platform dependent unsigned long long value */
- -unsigned long long mp_get_long_long(mp_int * a);
- +unsigned TCL_WIDE_INT_TYPE mp_get_long_long(mp_int * a);
- /* initialize and set a digit */
- int mp_init_set (mp_int * a, mp_digit b);
- --
- 2.11.1.windows.1