diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-12-08 16:55:03 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-12-08 16:55:03 (GMT) |
commit | 743e03cf5e6eb1b9679f21e613513de51f874878 (patch) | |
tree | 0f4eb4070d0d4a28ad38f4f9031721b8d8609495 | |
parent | d8fd9552b555513cd62d8be2ae422a92c7be9d0e (diff) | |
parent | 39bf69006a6847b4068bd3b9b8debda81197502a (diff) | |
download | tcl-743e03cf5e6eb1b9679f21e613513de51f874878.zip tcl-743e03cf5e6eb1b9679f21e613513de51f874878.tar.gz tcl-743e03cf5e6eb1b9679f21e613513de51f874878.tar.bz2 |
Merge 8.7
-rw-r--r-- | .travis.yml | 22 | ||||
-rw-r--r-- | generic/tclEncoding.c | 8 | ||||
-rw-r--r-- | generic/tclTimer.c | 2 | ||||
-rw-r--r-- | win/makefile.vc | 38 | ||||
-rw-r--r-- | win/rules.vc | 37 | ||||
-rw-r--r-- | win/tclWinFile.c | 7 |
6 files changed, 65 insertions, 49 deletions
diff --git a/.travis.yml b/.travis.yml index dd1e582..f1ba3ce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -109,20 +109,6 @@ matrix: compiler: clang env: - BUILD_DIR=unix - - name: "Linux/Clang/Shared: UTF_MAX=6" - os: linux - dist: xenial - compiler: clang - env: - - BUILD_DIR=unix - - CFGOPT=CFLAGS=-DTCL_UTF_MAX=6 - - name: "Linux/Clang/Shared: UTF_MAX=3" - os: linux - dist: xenial - compiler: clang - env: - - BUILD_DIR=unix - - CFGOPT=CFLAGS=-DTCL_UTF_MAX=3 - name: "Linux/Clang/Shared:NO_DEPRECATED" os: linux dist: xenial @@ -259,8 +245,8 @@ matrix: before_install: *vcpreinst install: [] script: - - cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=static -f makefile.vc all tcltest' - - cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=static -f makefile.vc test' + - cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=static,msvcrt -f makefile.vc all tcltest' + - cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=static,msvcrt -f makefile.vc test' - name: "Windows/MSVC/Debug" os: windows compiler: cl @@ -305,8 +291,8 @@ matrix: before_install: *vcpreinst install: [] script: - - cmd.exe /C 'vcvarsall.bat x86 && nmake OPTS=static -f makefile.vc all tcltest' - - cmd.exe /C 'vcvarsall.bat x86 && nmake OPTS=static -f makefile.vc test' + - cmd.exe /C 'vcvarsall.bat x86 && nmake OPTS=static,msvcrt -f makefile.vc all tcltest' + - cmd.exe /C 'vcvarsall.bat x86 && nmake OPTS=static,msvcrt -f makefile.vc test' - name: "Windows/MSVC-x86/Debug" os: windows compiler: cl diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index ae3e011..1bed847 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -622,13 +622,13 @@ TclInitEncodingSubsystem(void) type.freeProc = NULL; type.nullSize = 2; type.encodingName = "utf-16le"; - type.clientData = INT2PTR(1);; + type.clientData = INT2PTR(1); Tcl_CreateEncoding(&type); type.encodingName = "utf-16be"; type.clientData = INT2PTR(0); Tcl_CreateEncoding(&type); type.encodingName = "utf-16"; - type.clientData = INT2PTR(isLe.c);; + type.clientData = INT2PTR(isLe.c); Tcl_CreateEncoding(&type); #ifndef TCL_NO_DEPRECATED @@ -2414,13 +2414,13 @@ UtfToUtfProc( dst += Tcl_UniCharToUtf(*chPtr, dst); } else { src += TclUtfToUniChar(src, chPtr); - if ((*chPtr & 0xFC00) == 0xD800) { + if ((*chPtr | 0x3FF) == 0xDBFF) { /* A high surrogate character is detected, handle especially */ Tcl_UniChar low = *chPtr; if (src <= srcEnd-3) { Tcl_UtfToUniChar(src, &low); } - if ((low & 0xFC00) != 0xDC00) { + if ((low | 0x3FF) != 0xDFFF) { *dst++ = (char) (((*chPtr >> 12) | 0xE0) & 0xEF); *dst++ = (char) (((*chPtr >> 6) | 0x80) & 0xBF); *dst++ = (char) ((*chPtr | 0x80) & 0xBF); diff --git a/generic/tclTimer.c b/generic/tclTimer.c index 924881e..55466cc 100644 --- a/generic/tclTimer.c +++ b/generic/tclTimer.c @@ -897,7 +897,7 @@ Tcl_AfterObjCmd( if (objc == 3) { commandPtr = objv[2]; } else { - commandPtr = Tcl_ConcatObj(objc-2, objv+2);; + commandPtr = Tcl_ConcatObj(objc-2, objv+2); } command = TclGetStringFromObj(commandPtr, &length); for (afterPtr = assocPtr->firstAfterPtr; afterPtr != NULL; diff --git a/win/makefile.vc b/win/makefile.vc index 26504bc..5d85d55 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -52,30 +52,32 @@ # turn on the 64-bit compiler, if your SDK has it.
#
# Basic macros and options usable on the commandline (see rules.vc for more info):
-# OPTS=msvcrt,static,staticpkg,symbols,profile,unchecked,time64bit,utfmax,none
+# OPTS=msvcrt,nothreads,pdbs,profile,static,staticpkg,symbols,thrdalloc,time64bit,unchecked,utfmax,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.
#
-# msvcrt = Affects the static option only to switch it from
-# using libcmt(d) as the C runtime [by default] to
-# msvcrt(d). This is useful for static embedding
-# support.
-# static = Builds a static library of the core instead of a
-# dll. The shell will be static (and large), as well.
-# staticpkg= Affects the static option only to switch
-# tclshXX.exe to have the dde and reg extension linked
-# inside it.
+# msvcrt = Affects the static option only to switch it from
+# using libcmt(d) as the C runtime [by default] to
+# msvcrt(d). This is useful for static embedding
+# support.
+# nothreads = Turns off full multithreading support (default on).
+# pbds = Produce separate debug symbol files.
+# profile = Adds profiling hooks. Map file is assumed.
+# static = Builds a static library of the core instead of a
+# dll. The shell will be static (and large), as well.
+# staticpkg = Affects the static option only to switch
+# tclshXX.exe to have the dde and reg extension linked
+# inside it.
+# symbols = Adds symbols for step debugging.
# thrdalloc = Use the thread allocator (shared global free pool).
-# symbols = Adds symbols for step debugging.
-# profile = Adds profiling hooks. Map file is assumed.
-# 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).
-# utfmax = Forces Tcl_UniChar to be a 32-bit quantity in stead
-# of 16-bits
+# (CRT library should support this).
+# unchecked = Allows a symbols build to not use the debug
+# enabled runtime (msvcrt.dll not msvcrtd.dll
+# or libcmt.lib not libcmtd.lib).
+# utfmax = Forces a build allowing 4-byte UTF-8 sequences
+# internally.
#
# STATS=compdbg,memdbg,none
# Sets optional memory and bytecode compiler debugging code added
diff --git a/win/rules.vc b/win/rules.vc index 1206677..9302695 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -746,6 +746,15 @@ TCL_USE_STATIC_PACKAGES = 1 TCL_USE_STATIC_PACKAGES = 0
!endif
+!if [nmakehlp -f $(OPTS) "nothreads"]
+!message *** Compile explicitly for non-threaded tcl
+TCL_THREADS = 0
+USE_THREAD_ALLOC= 0
+!else
+TCL_THREADS = 1
+USE_THREAD_ALLOC= 1
+!endif
+
!if [nmakehlp -f $(OPTS) "time64bit"]
!message *** Force 64-bit time_t
_USE_64BIT_TIME_T = 1
@@ -793,6 +802,12 @@ PGO = 0 !message *** Warning: ignoring option "loimpact" - deprecated on modern Windows.
!endif
+# TBD - should get rid of this option
+!if [nmakehlp -f $(OPTS) "thrdalloc"]
+!message *** Doing thrdalloc
+USE_THREAD_ALLOC = 1
+!endif
+
!if [nmakehlp -f $(OPTS) "tclalloc"]
USE_THREAD_ALLOC = 0
!endif
@@ -1203,8 +1218,8 @@ tklibs = "$(TKSTUBLIB)" "$(TKIMPLIB)" !endif # $(DOING_TK) || $(NEED_TK)
# Various output paths
-PRJIMPLIB = $(OUT_DIR)\$(PROJECT)$(VERSION)$(SUFX:t=).lib
-PRJLIBNAME = $(PROJECT)$(VERSION)$(SUFX:t=).$(EXT)
+PRJIMPLIB = $(OUT_DIR)\$(PROJECT)$(VERSION)$(SUFX).lib
+PRJLIBNAME = $(PROJECT)$(VERSION)$(SUFX).$(EXT)
PRJLIB = $(OUT_DIR)\$(PRJLIBNAME)
PRJSTUBLIBNAME = $(STUBPREFIX)$(VERSION).lib
@@ -1337,11 +1352,11 @@ OPTDEFINES = $(OPTDEFINES) /DTCL_CFG_PROFILED OPTDEFINES = $(OPTDEFINES) /DTCL_CFG_DO64BIT
!endif
!if $(VCVERSION) < 1300
-OPTDEFINES = $(OPTDEFINES) /DNO_STRTOI64
+OPTDEFINES = $(OPTDEFINES) /DNO_STRTOI64=1
!endif
!if "$(_USE_64BIT_TIME_T)" == "1"
-OPTDEFINES = $(OPTDEFINES) /D_USE_64BIT_TIME_T
+OPTDEFINES = $(OPTDEFINES) /D_USE_64BIT_TIME_T=1
!endif
!if "$(TCL_UTF_MAX)" == "6"
OPTDEFINES = $(OPTDEFINES) /DTCL_UTF_MAX=6
@@ -1473,6 +1488,18 @@ lflags = -nologo -machine:$(MACHINE) $(LINKERFLAGS) $(ldebug) lflags = $(lflags) -nodefaultlib:libucrt.lib
!endif
+# Old linkers (Visual C++ 6 in particular) will link for fast loading
+# on Win98. Since we do not support Win98 any more, we specify nowin98
+# as recommended for NT and later. However, this is only required by
+# IX86 on older compilers and only needed if we are not doing a static build.
+
+!if "$(MACHINE)" == "IX86" && !$(STATIC_BUILD)
+!if [nmakehlp -l -opt:nowin98 $(LINKER_TESTFLAGS)]
+# Align sections for PE size savings.
+lflags = $(lflags) -opt:nowin98
+!endif
+!endif
+
dlllflags = $(lflags) -dll
conlflags = $(lflags) -subsystem:console
guilflags = $(lflags) -subsystem:windows
@@ -1517,7 +1544,7 @@ RESCMD = $(rc32) -fo $@ -r -i "$(GENERICDIR)" -i "$(TMP_DIR)" \ /DCOMMAVERSION=$(RCCOMMAVERSION) \
/DDOTVERSION=\"$(DOTVERSION)\" \
/DVERSION=\"$(VERSION)\" \
- /DSUFX=\"$(SUFX:t=)\" \
+ /DSUFX=\"$(SUFX)\" \
/DPROJECT=\"$(PROJECT)\" \
/DPRJLIBNAME=\"$(PRJLIBNAME)\"
diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 9a5e1f4..1380217 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -3046,7 +3046,7 @@ TclNativeCreateNativeRep( WCHAR *nativePathPtr = NULL; const char *str; Tcl_Obj *validPathPtr; - int len; + size_t len; WCHAR *wp; if (TclFSCwdIsNative()) { @@ -3083,9 +3083,10 @@ TclNativeCreateNativeRep( Tcl_IncrRefCount(validPathPtr); } - str = Tcl_GetStringFromObj(validPathPtr, &len); + str = Tcl_GetString(validPathPtr); + len = validPathPtr->length; - if (strlen(str) != (size_t) len) { + if (strlen(str) != len) { /* * String contains NUL-bytes. This is invalid. */ |