Tcl Source Code

Check-in [3b09ba4861]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Complete implementation vor MSVC (even building minigzip)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | digit-bit-60
Files: files | file ages | folders
SHA3-256:3b09ba4861e65ab42e4a879df0be55b765ca68acdc1f97a86ae9f2b843f6bb6f
User & Date: jan.nijtmans 2019-04-10 19:53:39
Context
2019-04-10
19:53
Complete implementation vor MSVC (even building minigzip) Leaf check-in: 3b09ba4861 user: jan.nijtmans tags: digit-bit-60
2019-04-09
19:21
Merge 8.7. Complete implementation for MSVC and for UNIX. check-in: b392834e2c user: jan.nijtmans tags: digit-bit-60
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to compat/zlib/contrib/minizip/ioapi.c.

10
11
12
13
14
15
16




17
18
19
20
21
22
23
24
*/

#if defined(_WIN32) && (!(defined(_CRT_SECURE_NO_WARNINGS)))
        #define _CRT_SECURE_NO_WARNINGS
#endif





#if defined(__APPLE__) || defined(IOAPI_NO_64)
// In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions
#define FOPEN_FUNC(filename, mode) fopen(filename, mode)
#define FTELLO_FUNC(stream) ftello(stream)
#define FSEEKO_FUNC(stream, offset, origin) fseeko(stream, offset, origin)
#else
#define FOPEN_FUNC(filename, mode) fopen64(filename, mode)
#define FTELLO_FUNC(stream) ftello64(stream)






>
>
>
>
|







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
*/

#if defined(_WIN32) && (!(defined(_CRT_SECURE_NO_WARNINGS)))
        #define _CRT_SECURE_NO_WARNINGS
#endif

#if defined(_WIN32)
#define FOPEN_FUNC(filename, mode) fopen(filename, mode)
#define FTELLO_FUNC(stream) _ftelli64(stream)
#define FSEEKO_FUNC(stream, offset, origin) _fseeki64(stream, offset, origin)
#elif defined(__APPLE__) || defined(IOAPI_NO_64)
// In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions
#define FOPEN_FUNC(filename, mode) fopen(filename, mode)
#define FTELLO_FUNC(stream) ftello(stream)
#define FSEEKO_FUNC(stream, offset, origin) fseeko(stream, offset, origin)
#else
#define FOPEN_FUNC(filename, mode) fopen64(filename, mode)
#define FTELLO_FUNC(stream) ftello64(stream)

Changes to compat/zlib/contrib/minizip/minizip.c.

23
24
25
26
27
28
29




30
31
32
33
34
35
36
37
                #define _LARGEFILE64_SOURCE
        #endif
        #ifndef _FILE_OFFSET_BIT
                #define _FILE_OFFSET_BIT 64
        #endif
#endif





#if defined(__APPLE__) || defined(IOAPI_NO_64)
// In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions
#define FOPEN_FUNC(filename, mode) fopen(filename, mode)
#define FTELLO_FUNC(stream) ftello(stream)
#define FSEEKO_FUNC(stream, offset, origin) fseeko(stream, offset, origin)
#else
#define FOPEN_FUNC(filename, mode) fopen64(filename, mode)
#define FTELLO_FUNC(stream) ftello64(stream)






>
>
>
>
|







23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
                #define _LARGEFILE64_SOURCE
        #endif
        #ifndef _FILE_OFFSET_BIT
                #define _FILE_OFFSET_BIT 64
        #endif
#endif

#if defined(_WIN32)
#define FOPEN_FUNC(filename, mode) fopen(filename, mode)
#define FTELLO_FUNC(stream) _ftelli64(stream)
#define FSEEKO_FUNC(stream, offset, origin) _fseeki64(stream, offset, origin)
#elif defined(__APPLE__) || defined(IOAPI_NO_64)
// In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions
#define FOPEN_FUNC(filename, mode) fopen(filename, mode)
#define FTELLO_FUNC(stream) ftello(stream)
#define FSEEKO_FUNC(stream, offset, origin) fseeko(stream, offset, origin)
#else
#define FOPEN_FUNC(filename, mode) fopen64(filename, mode)
#define FTELLO_FUNC(stream) ftello64(stream)

Changes to generic/tclStubInit.c.

134
135
136
137
138
139
140
141












142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
#define TclBN_mp_get_int mp_get_int
#define TclBN_mp_tc_and mp_tc_and
#define TclBN_mp_tc_or mp_tc_or
#define TclBN_mp_tc_xor mp_tc_xor
#define TclBN_mp_tc_div_2d mp_tc_div_2d
#define TclBN_mp_get_bit mp_get_bit

#if !defined(TCL_NO_DEPRECATED) && (!defined(_WIN32) || defined(STATIC_BUILD))












#define TclBN_reverse bn_reverse
#define TclBN_fast_s_mp_mul_digs fast_s_mp_mul_digs
#define TclBN_fast_s_mp_sqr fast_s_mp_sqr
#define TclBN_mp_karatsuba_mul mp_karatsuba_mul
#define TclBN_mp_karatsuba_sqr mp_karatsuba_sqr
#define TclBN_mp_toom_mul mp_toom_mul
#define TclBN_mp_toom_sqr mp_toom_sqr
#define TclBN_s_mp_add s_mp_add
#define TclBN_s_mp_mul_digs s_mp_mul_digs
#define TclBN_s_mp_sqr s_mp_sqr
#define TclBN_s_mp_sub s_mp_sub
#else
#define TclBN_reverse 0
#define TclBN_fast_s_mp_mul_digs 0
#define TclBN_fast_s_mp_sqr 0
#define TclBN_mp_karatsuba_mul 0
#define TclBN_mp_karatsuba_sqr 0
#define TclBN_mp_toom_mul 0
#define TclBN_mp_toom_sqr 0
#define TclBN_s_mp_add 0
#define TclBN_s_mp_mul_digs 0
#define TclBN_s_mp_sqr 0
#define TclBN_s_mp_sub 0
#endif

/* See bug 510001: TclSockMinimumBuffers needs plat imp */
#if defined(_WIN64) || defined(TCL_NO_DEPRECATED) || TCL_MAJOR_VERSION > 8
#   define TclSockMinimumBuffersOld 0
#else
#define TclSockMinimumBuffersOld sockMinimumBuffersOld






|
>
>
>
>
>
>
>
>
>
>
>
>











<
<
<
<
<
<
<
<
<
<
<
<







134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164












165
166
167
168
169
170
171
#define TclBN_mp_get_int mp_get_int
#define TclBN_mp_tc_and mp_tc_and
#define TclBN_mp_tc_or mp_tc_or
#define TclBN_mp_tc_xor mp_tc_xor
#define TclBN_mp_tc_div_2d mp_tc_div_2d
#define TclBN_mp_get_bit mp_get_bit

#if defined(TCL_NO_DEPRECATED) || defined(TCL_WITH_EXTERNAL_TOMMATH)
#define TclBN_reverse 0
#define TclBN_fast_s_mp_mul_digs 0
#define TclBN_fast_s_mp_sqr 0
#define TclBN_mp_karatsuba_mul 0
#define TclBN_mp_karatsuba_sqr 0
#define TclBN_mp_toom_mul 0
#define TclBN_mp_toom_sqr 0
#define TclBN_s_mp_add 0
#define TclBN_s_mp_mul_digs 0
#define TclBN_s_mp_sqr 0
#define TclBN_s_mp_sub 0
#else
#define TclBN_reverse bn_reverse
#define TclBN_fast_s_mp_mul_digs fast_s_mp_mul_digs
#define TclBN_fast_s_mp_sqr fast_s_mp_sqr
#define TclBN_mp_karatsuba_mul mp_karatsuba_mul
#define TclBN_mp_karatsuba_sqr mp_karatsuba_sqr
#define TclBN_mp_toom_mul mp_toom_mul
#define TclBN_mp_toom_sqr mp_toom_sqr
#define TclBN_s_mp_add s_mp_add
#define TclBN_s_mp_mul_digs s_mp_mul_digs
#define TclBN_s_mp_sqr s_mp_sqr
#define TclBN_s_mp_sub s_mp_sub












#endif

/* See bug 510001: TclSockMinimumBuffers needs plat imp */
#if defined(_WIN64) || defined(TCL_NO_DEPRECATED) || TCL_MAJOR_VERSION > 8
#   define TclSockMinimumBuffersOld 0
#else
#define TclSockMinimumBuffersOld sockMinimumBuffersOld

Changes to unix/configure.

4752
4753
4754
4755
4756
4757
4758
4759






4760
4761
4762
4763
4764
4765
4766
else

    libtommath_ok=no

fi

fi
if test $libtommath_ok = no; then :







  TOMMATH_OBJS=\${TOMMATH_OBJS}

  TOMMATH_SRCS=\${TOMMATH_SRCS}

  TOMMATH_INCLUDE=-I\${TOMMATH_DIR}







|
>
>
>
>
>
>







4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
else

    libtommath_ok=no

fi

fi
if test $libtommath_ok = yes; then :


$as_echo "#define TCL_WITH_EXTERNAL_TOMMATH 1" >>confdefs.h


else

  TOMMATH_OBJS=\${TOMMATH_OBJS}

  TOMMATH_SRCS=\${TOMMATH_SRCS}

  TOMMATH_INCLUDE=-I\${TOMMATH_DIR}

Changes to unix/configure.ac.

174
175
176
177
178
179
180
181


182
183
184
185
186
187
188
AC_CHECK_HEADER([tommath.h],[
  AC_CHECK_TYPE([mp_int],[],[libtommath_ok=no],[#include <tommath.h>])],[
  libtommath_ok=no])
AS_IF([test $libtommath_ok = yes], [
  AC_SEARCH_LIBS([mp_get_bit],[tommath],[],[
    libtommath_ok=no
  ])])
AS_IF([test $libtommath_ok = no], [


  AC_SUBST(TOMMATH_OBJS,[\${TOMMATH_OBJS}])
  AC_SUBST(TOMMATH_SRCS,[\${TOMMATH_SRCS}])
  AC_SUBST(TOMMATH_INCLUDE,[-I\${TOMMATH_DIR}])
])

#--------------------------------------------------------------------
# The statements below define a collection of compile flags.  This






|
>
>







174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
AC_CHECK_HEADER([tommath.h],[
  AC_CHECK_TYPE([mp_int],[],[libtommath_ok=no],[#include <tommath.h>])],[
  libtommath_ok=no])
AS_IF([test $libtommath_ok = yes], [
  AC_SEARCH_LIBS([mp_get_bit],[tommath],[],[
    libtommath_ok=no
  ])])
AS_IF([test $libtommath_ok = yes], [
  AC_DEFINE(TCL_WITH_EXTERNAL_TOMMATH, 1, [Tcl with external libtommath])
], [
  AC_SUBST(TOMMATH_OBJS,[\${TOMMATH_OBJS}])
  AC_SUBST(TOMMATH_SRCS,[\${TOMMATH_SRCS}])
  AC_SUBST(TOMMATH_INCLUDE,[-I\${TOMMATH_DIR}])
])

#--------------------------------------------------------------------
# The statements below define a collection of compile flags.  This

Changes to win/configure.

4593
4594
4595
4596
4597
4598
4599



4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
fi
if test "$tcl_ok" = "yes"; then :

  ZLIB_DLL_FILE=\${ZLIB_DLL_FILE}

  TOMMATH_DLL_FILE=\${TOMMATH_DLL_FILE}




  if test "$do64bit" != "no"; then :


$as_echo "#define MD_64BIT 1" >>confdefs.h

    if test "$GCC" == "yes"; then :

      ZLIB_LIBS=\${ZLIB_DIR_NATIVE}/win64/libz.dll.a

      TOMMATH_LIBS=\${TOMMATH_DIR_NATIVE}/win64/libtommath.dll.a







>
>
>



|







4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
fi
if test "$tcl_ok" = "yes"; then :

  ZLIB_DLL_FILE=\${ZLIB_DLL_FILE}

  TOMMATH_DLL_FILE=\${TOMMATH_DLL_FILE}


$as_echo "#define TCL_WITH_EXTERNAL_TOMMATH 1" >>confdefs.h

  if test "$do64bit" != "no"; then :


$as_echo "#define MP_64BIT 1" >>confdefs.h

    if test "$GCC" == "yes"; then :

      ZLIB_LIBS=\${ZLIB_DIR_NATIVE}/win64/libz.dll.a

      TOMMATH_LIBS=\${TOMMATH_DIR_NATIVE}/win64/libtommath.dll.a

Changes to win/configure.ac.

120
121
122
123
124
125
126

127
128
129
130
131
132
133
134
135
  tcl_ok=$enableval
], [
  tcl_ok=yes
])
AS_IF([test "$tcl_ok" = "yes"], [
  AC_SUBST(ZLIB_DLL_FILE,[\${ZLIB_DLL_FILE}])
  AC_SUBST(TOMMATH_DLL_FILE,[\${TOMMATH_DLL_FILE}])

  AS_IF([test "$do64bit" != "no"], [
    AC_DEFINE(MD_64BIT, 1, [Using libtommath.dll in 64-bit mode])
    AS_IF([test "$GCC" == "yes"],[
      AC_SUBST(ZLIB_LIBS,[\${ZLIB_DIR_NATIVE}/win64/libz.dll.a])
      AC_SUBST(TOMMATH_LIBS,[\${TOMMATH_DIR_NATIVE}/win64/libtommath.dll.a])
    ], [
      AC_SUBST(ZLIB_LIBS,[\${ZLIB_DIR_NATIVE}/win64/zdll.lib])
      AC_SUBST(TOMMATH_LIBS,[\${TOMMATH_DIR_NATIVE}/win64/tommath.lib])
    ])






>

|







120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
  tcl_ok=$enableval
], [
  tcl_ok=yes
])
AS_IF([test "$tcl_ok" = "yes"], [
  AC_SUBST(ZLIB_DLL_FILE,[\${ZLIB_DLL_FILE}])
  AC_SUBST(TOMMATH_DLL_FILE,[\${TOMMATH_DLL_FILE}])
  AC_DEFINE(TCL_WITH_EXTERNAL_TOMMATH, 1, [Tcl with external libtommath])
  AS_IF([test "$do64bit" != "no"], [
    AC_DEFINE(MP_64BIT, 1, [Using libtommath.dll in 64-bit mode])
    AS_IF([test "$GCC" == "yes"],[
      AC_SUBST(ZLIB_LIBS,[\${ZLIB_DIR_NATIVE}/win64/libz.dll.a])
      AC_SUBST(TOMMATH_LIBS,[\${TOMMATH_DIR_NATIVE}/win64/libtommath.dll.a])
    ], [
      AC_SUBST(ZLIB_LIBS,[\${ZLIB_DIR_NATIVE}/win64/zdll.lib])
      AC_SUBST(TOMMATH_LIBS,[\${TOMMATH_DIR_NATIVE}/win64/tommath.lib])
    ])