diff options
-rw-r--r-- | generic/tclMain.c | 3 | ||||
-rw-r--r-- | unix/tclUnixFile.c | 7 | ||||
-rw-r--r-- | win/makefile.vc | 7 | ||||
-rwxr-xr-x | win/tclWinFile.c | 2 |
4 files changed, 16 insertions, 3 deletions
diff --git a/generic/tclMain.c b/generic/tclMain.c index 360f5e9..c2300c2 100644 --- a/generic/tclMain.c +++ b/generic/tclMain.c @@ -80,7 +80,10 @@ NewNativeObj( * 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. diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c index 2cb0027..7ffbf8d 100644 --- a/unix/tclUnixFile.c +++ b/unix/tclUnixFile.c @@ -155,6 +155,11 @@ TclpFindExecutable( goto done; } + if (TclpGetCwd(NULL, &cwd) == NULL) { + TclSetObjNameOfExecutable(Tcl_NewObj(), NULL); + goto done; + } + /* * The name is relative to the current working directory. First strip off * a leading "./", if any, then add the full path name of the current @@ -168,8 +173,6 @@ TclpFindExecutable( Tcl_DStringInit(&nameString); Tcl_DStringAppend(&nameString, name, -1); - TclpGetCwd(NULL, &cwd); - Tcl_DStringFree(&buffer); Tcl_UtfToExternalDString(NULL, Tcl_DStringValue(&cwd), Tcl_DStringLength(&cwd), &buffer); diff --git a/win/makefile.vc b/win/makefile.vc index be05e73..024ecb0 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -530,6 +530,10 @@ lflags = -nologo -machine:$(MACHINE) $(LINKERFLAGS) $(ldebug) lflags = $(lflags) -profile
!endif
+!if $(MSVCRT) && !($(DEBUG) && !$(UNCHECKED)) && $(VCVERSION) >= 1900
+lflags = $(lflags) -nodefaultlib:libucrt.lib
+!endif
+
!if $(ALIGN98_HACK) && !$(STATIC_BUILD)
### Align sections for PE size savings.
lflags = $(lflags) -opt:nowin98
@@ -554,6 +558,9 @@ baselibs = netapi32.lib kernel32.lib user32.lib advapi32.lib ws2_32.lib baselibs = $(baselibs) bufferoverflowU.lib
!endif
!endif
+!if $(MSVCRT) && !($(DEBUG) && !$(UNCHECKED)) && $(VCVERSION) >= 1900
+baselibs = $(baselibs) ucrt.lib
+!endif
#---------------------------------------------------------------------
# TclTest flags
diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 6b9d373..02927ad 100755 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -3001,7 +3001,7 @@ TclNativeCreateNativeRep( } done: - + TclDecrRefCount(validPathPtr); return nativePathPtr; } |