summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tcl.h2
-rwxr-xr-xwin/configure20
-rw-r--r--win/configure.in14
-rw-r--r--win/makefile.vc4
-rw-r--r--win/rules.vc12
-rw-r--r--win/tclWinPort.h10
6 files changed, 54 insertions, 8 deletions
diff --git a/generic/tcl.h b/generic/tcl.h
index f05112e..bc4d9a6 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -414,7 +414,7 @@ typedef unsigned TCL_WIDE_INT_TYPE Tcl_WideUInt;
#if defined(__WIN32__)
# ifdef __BORLANDC__
typedef struct stati64 Tcl_StatBuf;
-# elif defined(_WIN64) || defined(__MINGW_USE_VC2005_COMPAT)
+# elif defined(_WIN64) || defined(__MINGW_USE_VC2005_COMPAT) || defined(_USE_64BIT_TIME_T)
typedef struct __stat64 Tcl_StatBuf;
# elif (defined(_MSC_VER) && (_MSC_VER < 1400)) || defined(_USE_32BIT_TIME_T)
typedef struct _stati64 Tcl_StatBuf;
diff --git a/win/configure b/win/configure
index 3a77f00..b754717 100755
--- a/win/configure
+++ b/win/configure
@@ -842,6 +842,7 @@ Optional Features:
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-threads build with threads (default: off)
--enable-shared build and link with shared libraries (default: on)
+ --enable-time64bit force 64-bit time_t for 32-bit build (default: off)
--enable-64bit enable 64bit support (where applicable)
--enable-wince enable Win/CE support (where applicable)
--enable-symbols build with debugging symbols (default: off)
@@ -3148,6 +3149,25 @@ _ACEOF
#--------------------------------------------------------------------
+# Check whether --enable-time64bit was given.
+#--------------------------------------------------------------------
+
+echo "$as_me:$LINENO: checking force of 64-bit time_t" >&5
+echo $ECHO_N "checking force of 64-bit time_t... $ECHO_C" >&6
+# Check whether --enable-time64bit or --disable-time64bit was given.
+if test "${enable_time64bit+set}" = set; then
+ enableval="$enable_time64bit"
+ tcl_ok=$enableval
+else
+ tcl_ok=no
+fi;
+echo "$as_me:$LINENO: result: \"$tcl_ok\"" >&5
+echo "${ECHO_T}\"$tcl_ok\"" >&6
+if test "$tcl_ok" = "yes"; then
+ CFLAGS="${CFLAGS} -D_USE_64BIT_TIME_T"
+fi
+
+#--------------------------------------------------------------------
# The statements below define a collection of compile flags. This
# macro depends on the value of SHARED_BUILD, and should be called
# after SC_ENABLE_SHARED checks the configure switches.
diff --git a/win/configure.in b/win/configure.in
index 12c81ed..dc597b9 100644
--- a/win/configure.in
+++ b/win/configure.in
@@ -91,6 +91,20 @@ SC_TCL_CFG_ENCODING
SC_ENABLE_SHARED
#--------------------------------------------------------------------
+# Check whether --enable-time64bit was given.
+#--------------------------------------------------------------------
+
+AC_MSG_CHECKING([force of 64-bit time_t])
+AC_ARG_ENABLE(time64bit,
+ AC_HELP_STRING([--enable-time64bit],
+ [force 64-bit time_t for 32-bit build (default: off)]),
+ [tcl_ok=$enableval], [tcl_ok=no])
+AC_MSG_RESULT("$tcl_ok")
+if test "$tcl_ok" = "yes"; then
+ CFLAGS="${CFLAGS} -D_USE_64BIT_TIME_T"
+fi
+
+#--------------------------------------------------------------------
# The statements below define a collection of compile flags. This
# macro depends on the value of SHARED_BUILD, and should be called
# after SC_ENABLE_SHARED checks the configure switches.
diff --git a/win/makefile.vc b/win/makefile.vc
index cc340a8..fc6191f 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -70,7 +70,7 @@ the build instructions.
# Sets where to install Tcl from the built binaries.
# C:\Progra~1\Tcl is assumed when not specified.
#
-# OPTS=loimpact,msvcrt,static,staticpkg,symbols,threads,profile,unchecked,none
+# OPTS=loimpact,msvcrt,static,staticpkg,symbols,threads,profile,unchecked,time64bit,none
# Sets special options for the core. The default is for none.
# Any combination of the above may be used (comma separated).
# 'none' will over-ride everything to nothing.
@@ -94,6 +94,8 @@ the build instructions.
# unchecked = Allows a symbols build to not use the debug
# enabled runtime (msvcrt.dll not msvcrtd.dll
# or libcmt.lib not libcmtd.lib).
+# time64bit = Forces a build using 64-bit time_t for 32-bit build
+# (CRT library should support this).
#
# STATS=compdbg,memdbg,none
# Sets optional memory and bytecode compiler debugging code added
diff --git a/win/rules.vc b/win/rules.vc
index 33ebfe2..812e607 100644
--- a/win/rules.vc
+++ b/win/rules.vc
@@ -253,12 +253,16 @@ TCL_USE_STATIC_PACKAGES = 0
!endif
!if [nmakehlp -f $(OPTS) "threads"]
!message *** Doing threads
-TCL_THREADS = 1
+TCL_THREADS = 1
USE_THREAD_ALLOC = 1
!else
-TCL_THREADS = 0
+TCL_THREADS = 0
USE_THREAD_ALLOC = 0
!endif
+!if [nmakehlp -f $(OPTS) "time64bit"]
+!message *** Force 64-bit time_t
+_USE_64BIT_TIME_T = 1
+!endif
!if [nmakehlp -f $(OPTS) "symbols"]
!message *** Doing symbols
DEBUG = 1
@@ -488,6 +492,10 @@ OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_DO64BIT
OPTDEFINES = $(OPTDEFINES) -DNO_STRTOI64
!endif
+!if "$(_USE_64BIT_TIME_T)" == "1"
+OPTDEFINES = $(OPTDEFINES) -D_USE_64BIT_TIME_T
+!endif
+
#----------------------------------------------------------
# Locate the Tcl headers to build against
#----------------------------------------------------------
diff --git a/win/tclWinPort.h b/win/tclWinPort.h
index 8b42348..dce5557 100644
--- a/win/tclWinPort.h
+++ b/win/tclWinPort.h
@@ -15,10 +15,12 @@
#define _TCLWINPORT
#if !defined(_WIN64) && !defined(_USE_32BIT_TIME_T) && !defined(__MINGW_USE_VC2005_COMPAT)
-# if defined(__MINGW32__) || (defined(_MSC_VER) && _MSC_VER >= 1400)
-# define __MINGW_USE_VC2005_COMPAT
- /* define _USE_64BIT_TIME_T to force 64-bit time_t */
-# elif !defined(_USE_64BIT_TIME_T)
+ /* define _USE_64BIT_TIME_T (or make/configure option time64bit) to force 64-bit time_t */
+# if defined(_USE_64BIT_TIME_T)
+# if defined(__MINGW32__)
+# define __MINGW_USE_VC2005_COMPAT
+# endif
+# else
/* See [Bug 3354324]: file mtime sets wrong time */
# define _USE_32BIT_TIME_T
# endif