summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2019-07-12 11:20:15 (GMT)
committersebres <sebres@users.sourceforge.net>2019-07-12 11:20:15 (GMT)
commit69d77fc137dfe0dae543983211539fccd42bf428 (patch)
tree88e4a07402b029d881a3a0faf63c50cbfb60498e /win
parentb032f6d67b8090495120026fd1677d06bc353b4d (diff)
parent0ac369da08268513bd59ff640a4effd77027a012 (diff)
downloadtcl-69d77fc137dfe0dae543983211539fccd42bf428.zip
tcl-69d77fc137dfe0dae543983211539fccd42bf428.tar.gz
tcl-69d77fc137dfe0dae543983211539fccd42bf428.tar.bz2
integrate branch bug-4718b41c56, closes [4718b41c56]
Diffstat (limited to 'win')
-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.h6
-rw-r--r--win/tclWinTest.c23
6 files changed, 75 insertions, 4 deletions
diff --git a/win/configure b/win/configure
index 5fdb738..d9e945b 100755
--- a/win/configure
+++ b/win/configure
@@ -1381,6 +1381,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)
@@ -3756,6 +3757,25 @@ $as_echo "#define STATIC_BUILD 1" >>confdefs.h
#--------------------------------------------------------------------
+# 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 c30d1bd..b14aa6b 100644
--- a/win/tclWinPort.h
+++ b/win/tclWinPort.h
@@ -14,7 +14,11 @@
#ifndef _TCLWINPORT
#define _TCLWINPORT
-#ifndef _WIN64
+/* define _USE_64BIT_TIME_T (or make/configure option time64bit) to force 64-bit time_t */
+#if defined(_USE_64BIT_TIME_T)
+#define __MINGW_USE_VC2005_COMPAT
+#endif
+#if !defined(_WIN64) && !defined(__MINGW_USE_VC2005_COMPAT)
/* See [Bug 3354324]: file mtime sets wrong time */
# define _USE_32BIT_TIME_T
#endif
diff --git a/win/tclWinTest.c b/win/tclWinTest.c
index 7f49b63..dd5a60e 100644
--- a/win/tclWinTest.c
+++ b/win/tclWinTest.c
@@ -39,6 +39,8 @@ static int TestwinclockCmd(ClientData dummy, Tcl_Interp* interp,
int objc, Tcl_Obj *const objv[]);
static int TestwinsleepCmd(ClientData dummy, Tcl_Interp* interp,
int objc, Tcl_Obj *const objv[]);
+static int TestSizeCmd(ClientData dummy, Tcl_Interp* interp,
+ int objc, Tcl_Obj *const objv[]);
static Tcl_ObjCmdProc TestExceptionCmd;
static int TestplatformChmod(const char *nativePath, int pmode);
static int TestchmodCmd(ClientData dummy,
@@ -76,6 +78,7 @@ TclplatformtestInit(
Tcl_CreateObjCommand(interp, "testwinclock", TestwinclockCmd, NULL, NULL);
Tcl_CreateObjCommand(interp, "testwinsleep", TestwinsleepCmd, NULL, NULL);
Tcl_CreateObjCommand(interp, "testexcept", TestExceptionCmd, NULL, NULL);
+ Tcl_CreateObjCommand(interp, "testsize", TestSizeCmd, NULL, NULL);
return TCL_OK;
}
@@ -309,6 +312,26 @@ TestwinsleepCmd(
return TCL_OK;
}
+static int
+TestSizeCmd(
+ ClientData clientData, /* Unused */
+ Tcl_Interp* interp, /* Tcl interpreter */
+ int objc, /* Parameter count */
+ Tcl_Obj *const * objv) /* Parameter vector */
+{
+ if (objc != 2) {
+ goto syntax;
+ }
+ if (strcmp(Tcl_GetString(objv[1]), "time_t") == 0) {
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(sizeof(time_t)));
+ return TCL_OK;
+ }
+
+syntax:
+ Tcl_WrongNumArgs(interp, 1, objv, "time_t");
+ return TCL_ERROR;
+}
+
/*
*----------------------------------------------------------------------
*