Index: tcl-core-8.6.4.1/generic/tclMain.c =================================================================== --- tcl-core-8.6.4.1/generic/tclMain.c (revision 89060) +++ tcl-core-8.6.4.1/generic/tclMain.c (working copy) @@ -80,7 +80,10 @@ * source directory to make their own modified versions). */ +#if defined _MSC_VER && _MSC_VER < 1900 +/* isatty is always defined on MSVC 14.0, but not necessarily as CRTIMPORT. */ extern CRTIMPORT int isatty(int fd); +#endif /* * The thread-local variables for this file's functions. Index: tcl-core-8.6.4.1/win/makefile.vc =================================================================== --- tcl-core-8.6.4.1/win/makefile.vc (revision 89060) +++ tcl-core-8.6.4.1/win/makefile.vc (working copy) @@ -71,7 +71,7 @@ # Sets where to install Tcl from the built binaries. # C:\Progra~1\Tcl is assumed when not specified. # -# OPTS=loimpact,msvcrt,nothreads,pdbs,profile,static,staticpkg,symbols,thrdalloc,tclalloc,unchecked,none +# OPTS=loimpact,msvcrt,nothreads,pdbs,profile,static,staticpkg,symbols,thrdalloc,tclalloc,unchecked,ucrt,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. @@ -102,6 +102,11 @@ # unchecked= Allows a symbols build to not use the debug # enabled runtime (msvcrt.dll not msvcrtd.dll # or libcmt.lib not libcmtd.lib). +# ucrt= Uses ucrt.lib and libvcruntime.lib, which +# ensures Tcl will run on machines with only the subset +# of the C runtime that is part of the operating system. +# If omitted, builds with VC 14.0 or later will require +# the full C runtime redistributable. # # STATS=compdbg,memdbg,none # Sets optional memory and bytecode compiler debugging code added @@ -488,10 +493,16 @@ cwarn = $(WARNINGS) -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE cflags = -nologo -c $(COMPILERFLAGS) $(cwarn) -Fp$(TMP_DIR)^\ -!if $(MSVCRT) +!if $(UCRT) !if $(DEBUG) && !$(UNCHECKED) crt = -MDd !else +crt = -MT +!endif +!elseif $(MSVCRT) +!if $(DEBUG) && !$(UNCHECKED) +crt = -MDd +!else crt = -MD !endif !else @@ -530,6 +541,10 @@ lflags = $(lflags) -profile !endif +!if $(UCRT) && ($(UNCHECKED) || !$(DEBUG)) +lflags = $(lflags) -nodefaultlib:libucrt.lib +!endif + !if $(ALIGN98_HACK) && !$(STATIC_BUILD) ### Align sections for PE size savings. lflags = $(lflags) -opt:nowin98 @@ -554,6 +569,9 @@ baselibs = $(baselibs) bufferoverflowU.lib !endif !endif +!if $(UCRT) && ($(UNCHECKED) || !$(DEBUG)) +baselibs = $(baselibs) ucrt.lib +!endif #--------------------------------------------------------------------- # TclTest flags Index: tcl-core-8.6.4.1/win/rules.vc =================================================================== --- tcl-core-8.6.4.1/win/rules.vc (revision 89060) +++ tcl-core-8.6.4.1/win/rules.vc (working copy) @@ -223,6 +223,7 @@ TCL_USE_STATIC_PACKAGES = 0 USE_THREAD_ALLOC = 1 UNCHECKED = 0 +UCRT = 0 !else !if [nmakehlp -f $(OPTS) "static"] !message *** Doing static @@ -302,6 +303,12 @@ UNCHECKED = 0 !endif !endif +!if [nmakehlp -f $(OPTS) "ucrt"] && $(VCVERSION) >= 1900 +!message *** Doing UCRT +UCRT = 1 +!else +UCRT = 0 +!endif #---------------------------------------------------------- # Figure-out how to name our intermediate and output directories. Index: tix-8.4.3.4/win/makefile.vc =================================================================== --- tix-8.4.3.4/win/makefile.vc (revision 89060) +++ tix-8.4.3.4/win/makefile.vc (working copy) @@ -127,6 +127,19 @@ RM = del # +# Compile flags +# + +cflags = -c -W3 -nologo + +!IF "$(UCRT)" == "1" +cflags = $(cflags) -MT +!else +cflags = $(cflags) -MD +!endif + + +# # Link flags # @@ -146,6 +159,11 @@ lflags = $(lcommon) /MACHINE:$(MACHINE) !ENDIF +!IF "$(UCRT)" == "1" +lflags = $(lflags) -nodefaultlib:libucrt.lib +optlibs = $(optlibs) ucrt.lib +!endif + dlllflags = $(lflags) -dll baselibs = kernel32.lib $(optlibs) advapi32.lib user32.lib @@ -163,8 +181,11 @@ optflags = -Od -Zi !ENDIF -cvarsdll = -DWIN32 -D_WIN32 -D_MT -D_DLL -DSTDC_HEADERS -cflagsdll = $(cvarsdll) -c -W3 -nologo -Fp$(TMPDIR)\ -MD \ +cvarsdll = -DWIN32 -D_WIN32 -D_MT -DSTDC_HEADERS +!IF "$(UCRT)" != "1" +cvarsdll = $(cvarsdll) -D_DLL +!ENDIF +cflagsdll = $(cvarsdll) $(cflags) -Fp$(TMPDIR)\ \ $(optflags) ###################################################################### @@ -269,7 +290,7 @@ TIX_DLL = $(TMPDIR)\tix$(TIX_MAJOR)$(TIX_MINOR)$(DBGX).dll TIX_PKGIDX = $(TMPDIR)\pkgIndex.tcl.src -TIX_DEFINES = -D__WIN32__ +TIX_DEFINES = -D__WIN32__ -D_CRT_SECURE_NO_WARNINGS TIX_INCLUDES = $(include32) \ -I$(ROOT)\win -I$(ROOT)\generic \ -I$(TK_DIR)\generic -I$(TK_DIR)\win -I$(TK_DIR)\xlib \ Index: tk-8.6.4.1/win/makefile.vc =================================================================== --- tk-8.6.4.1/win/makefile.vc (revision 89060) +++ tk-8.6.4.1/win/makefile.vc (working copy) @@ -76,7 +76,7 @@ # Sets where to install Tcl from the built binaries. # C:\Progra~1\Tcl is assumed when not specified. # -# OPTS=loimpact,msvcrt,nothreads,noxp,pdbs,profile,square,static,staticpkg,symbols,unchecked,none +# OPTS=loimpact,msvcrt,nothreads,noxp,pdbs,profile,square,static,staticpkg,symbols,unchecked,ucrt,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. @@ -105,6 +105,11 @@ # unchecked = Allows a symbols build to not use the debug # enabled runtime (msvcrt.dll not msvcrtd.dll # or libcmt.lib not libcmtd.lib). +# ucrt= Uses ucrt.lib and libvcruntime.lib, which +# ensures Tcl will run on machines with only the subset +# of the C runtime that is part of the operating system. +# If omitted, builds with VC 14.0 or later will require +# the full C runtime redistributable. # # STATS=compdbg,memdbg,none # Sets optional memory and bytecode compiler debugging code added @@ -460,10 +465,16 @@ cwarn = $(WARNINGS) -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE cflags = -nologo -c $(COMPILERFLAGS) $(cwarn) -Fp$(TMP_DIR)^\ -!if $(MSVCRT) +!if $(UCRT) !if $(DEBUG) && !$(UNCHECKED) crt = -MDd !else +crt = -MT +!endif +!elseif $(MSVCRT) +!if $(DEBUG) && !$(UNCHECKED) +crt = -MDd +!else crt = -MD !endif !else @@ -500,6 +511,10 @@ lflags = $(lflags) -profile !endif +!if $(UCRT) && ($(UNCHECKED) || !$(DEBUG)) +lflags = $(lflags) -nodefaultlib:libucrt.lib +!endif + !if $(ALIGN98_HACK) && !$(STATIC_BUILD) ### Align sections for PE size savings. lflags = $(lflags) -opt:nowin98 @@ -526,6 +541,11 @@ baselibs = $(baselibs) bufferoverflowU.lib !endif !endif + +!if $(UCRT) && ($(UNCHECKED) || !$(DEBUG)) +baselibs = $(baselibs) ucrt.lib +!endif + guilibs = $(baselibs) gdi32.lib Index: tk-8.6.4.1/win/rules.vc =================================================================== --- tk-8.6.4.1/win/rules.vc (revision 89060) +++ tk-8.6.4.1/win/rules.vc (working copy) @@ -223,6 +223,7 @@ TCL_USE_STATIC_PACKAGES = 0 USE_THREAD_ALLOC = 1 UNCHECKED = 0 +UCRT = 0 !else !if [nmakehlp -f $(OPTS) "static"] !message *** Doing static @@ -302,6 +303,12 @@ UNCHECKED = 0 !endif !endif +!if [nmakehlp -f $(OPTS) "ucrt"] && $(VCVERSION) >= 1900 +!message *** Doing UCRT +UCRT = 1 +!else +UCRT = 0 +!endif #---------------------------------------------------------- # Figure-out how to name our intermediate and output directories.