From 3a83abc685b4ac6238014a7064f3384f2282a202 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 14 Jul 2015 19:50:15 +0000 Subject: Fixed bug [2886436fff] - [.txt delete] deletes before start index - This is option 1: change the behavior of the text widget to completely avoid any deletion before index1 --- generic/tkText.c | 12 +++--------- tests/text.test | 3 ++- tests/textDisp.test | 8 ++++---- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/generic/tkText.c b/generic/tkText.c index 139e71d..f023509 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -2999,11 +2999,9 @@ DeleteIndexRange( * The code below is ugly, but it's needed to make sure there is always a * dummy empty line at the end of the text. If the final newline of the * file (just before the dummy line) is being deleted, then back up index - * to just before the newline. If there is a newline just before the first - * character being deleted, then back up the first index too, so that an - * even number of lines gets deleted. Furthermore, remove any tags that - * are present on the newline that isn't going to be deleted after all - * (this simulates deleting the newline and then adding a "clean" one back + * to just before the newline. Furthermore, remove any tags that are + * present on the newline that isn't going to be deleted after all (this + * simulates deleting the newline and then adding a "clean" one back * again). Note that index1 and index2 might now be equal again which * means that no text will be deleted but tags might be removed. */ @@ -3018,10 +3016,6 @@ DeleteIndexRange( oldIndex2 = index2; TkTextIndexBackChars(NULL, &oldIndex2, 1, &index2, COUNT_INDICES); line2--; - if ((index1.byteIndex == 0) && (line1 != 0)) { - TkTextIndexBackChars(NULL, &index1, 1, &index1, COUNT_INDICES); - line1--; - } arrayPtr = TkBTreeGetTags(&index2, NULL, &arraySize); if (arrayPtr != NULL) { for (i = 0; i < arraySize; i++) { diff --git a/tests/text.test b/tests/text.test index e75f38a..53196be 100644 --- a/tests/text.test +++ b/tests/text.test @@ -1267,9 +1267,10 @@ test text-17.8 {DeleteChars procedure} { .t tag add sel 1.0 end .t delete 4.0 end list [.t tag ranges sel] [.t get 1.0 end] -} {{1.0 3.5} {Line 1 +} {{1.0 4.0} {Line 1 abcde 12345 + }} test text-17.9 {DeleteChars procedure} { setup diff --git a/tests/textDisp.test b/tests/textDisp.test index aed842c..dbfeb95 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -653,7 +653,7 @@ test textDisp-4.9 {UpdateDisplayInfo, filling in extra vertical space} {textfont update .t delete 15.0 end list [.t bbox 7.0] [.t bbox 12.0] -} [list [list 3 [expr {2*$fixedDiff + 29}] 7 $fixedHeight] [list 3 [expr {7*$fixedDiff + 94}] 7 $fixedHeight]] +} [list [list 3 [expr {2*$fixedDiff + 14}] 7 $fixedHeight] [list 3 [expr {7*$fixedDiff + 79}] 7 $fixedHeight]] test textDisp-4.10 {UpdateDisplayInfo, filling in extra vertical space} { .t delete 1.0 end .t insert end "1\n2\n3\n4\n5\nLine 6 is such a long line that it wraps around.\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17" @@ -662,7 +662,7 @@ test textDisp-4.10 {UpdateDisplayInfo, filling in extra vertical space} { .t delete 13.0 end update list [.t index @0,0] $tk_textRelayout $tk_textRedraw -} {5.0 {12.0 7.0 6.40 6.20 6.0 5.0} {5.0 6.0 6.20 6.40 7.0 12.0}} +} {6.0 {13.0 7.0 6.40 6.20 6.0} {6.0 6.20 6.40 7.0 13.0}} test textDisp-4.11 {UpdateDisplayInfo, filling in extra vertical space} { .t delete 1.0 end .t insert end "1\n2\n3\n4\n5\nLine 6 is such a long line that it wraps around, not once but really quite a few times.\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17" @@ -671,7 +671,7 @@ test textDisp-4.11 {UpdateDisplayInfo, filling in extra vertical space} { .t delete 14.0 end update list [.t index @0,0] $tk_textRelayout $tk_textRedraw -} {6.40 {13.0 7.0 6.80 6.60 6.40} {6.40 6.60 6.80 7.0 13.0}} +} {6.60 {14.0 7.0 6.80 6.60} {6.60 6.80 7.0 14.0}} test textDisp-4.12 {UpdateDisplayInfo, filling in extra vertical space} { .t delete 1.0 end .t insert end "1\n2\n3\n4\n5\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16" @@ -3659,7 +3659,7 @@ test textDisp-28.1 {"yview" option with bizarre scroll command} { set result [.t2.t index @0,0] update lappend result [.t2.t index @0,0] -} {6.0 1.0} +} {6.0 2.0} test textDisp-29.1 {miscellaneous: lines wrap but are still too long} {textfonts} { catch {destroy .t2} -- cgit v0.12 From 4f75be674fee3a89f9c8d99df95c2a9b668b8937 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 15 Jul 2015 13:27:58 +0000 Subject: Fix signature of TkMacOSXSetDrawingEnabled(), re-generate tkIntPlatDecls.h and tkStubInit.c --- generic/tkInt.decls | 2 +- generic/tkIntPlatDecls.h | 7 +++++-- generic/tkStubInit.c | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/generic/tkInt.decls b/generic/tkInt.decls index 7921852..f24d48c 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -957,7 +957,7 @@ declare 51 aqua { void TkGenWMDestroyEvent(Tk_Window tkwin) } declare 52 aqua { - TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag); + void TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag) } # removed duplicate from tkPlat table (tk.decls) diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index 7654b5d..86127fe 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -723,7 +723,7 @@ typedef struct TkIntPlatStubs { Window (*tkGetTransientMaster) (TkWindow *winPtr); /* 49 */ int (*tkGenerateButtonEvent) (int x, int y, Window window, unsigned int state); /* 50 */ void (*tkGenWMDestroyEvent) (Tk_Window tkwin); /* 51 */ - VOID *reserved52; + void (*tkMacOSXSetDrawingEnabled) (TkWindow *winPtr, int flag); /* 52 */ unsigned long (*tkpGetMS) (void); /* 53 */ VOID * (*tkMacOSXDrawable) (Drawable drawable); /* 54 */ int (*tkpScanWindowId) (Tcl_Interp *interp, CONST char *string, Window *idPtr); /* 55 */ @@ -1129,7 +1129,10 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr; #define TkGenWMDestroyEvent \ (tkIntPlatStubsPtr->tkGenWMDestroyEvent) /* 51 */ #endif -/* Slot 52 is reserved */ +#ifndef TkMacOSXSetDrawingEnabled +#define TkMacOSXSetDrawingEnabled \ + (tkIntPlatStubsPtr->tkMacOSXSetDrawingEnabled) /* 52 */ +#endif #ifndef TkpGetMS #define TkpGetMS \ (tkIntPlatStubsPtr->tkpGetMS) /* 53 */ diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index 3ee54dd..90a124f 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -588,7 +588,7 @@ TkIntPlatStubs tkIntPlatStubs = { TkGetTransientMaster, /* 49 */ TkGenerateButtonEvent, /* 50 */ TkGenWMDestroyEvent, /* 51 */ - NULL, /* 52 */ + TkMacOSXSetDrawingEnabled, /* 52 */ TkpGetMS, /* 53 */ TkMacOSXDrawable, /* 54 */ TkpScanWindowId, /* 55 */ -- cgit v0.12 From f286e06ad2da094e8154ec23f9b379d5cadd4f2d Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 28 Jul 2015 20:30:08 +0000 Subject: Fixed bug [1236306fff] - TraverseToMenu error with alt binding to toplevel destroy --- library/menu.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/menu.tcl b/library/menu.tcl index fd814b3..4875477 100644 --- a/library/menu.tcl +++ b/library/menu.tcl @@ -1037,7 +1037,7 @@ proc ::tk::MenuFind {w char} { proc ::tk::TraverseToMenu {w char} { variable ::tk::Priv - if {$char eq ""} { + if {![winfo exists $w] || $char eq ""} { return } while {[winfo class $w] eq "Menu"} { -- cgit v0.12 From 5da8b2cf18ec7d214d94b627b90307d055afd46f Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 28 Jul 2015 22:17:23 +0000 Subject: Made textDisp-4.9 more robust to font variations across platforms, so that it passes on Linux Debian 6.0 --- tests/textDisp.test | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/textDisp.test b/tests/textDisp.test index dbfeb95..a6bbfd7 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -615,6 +615,10 @@ catch {destroy .f2} .t configure -borderwidth 0 -wrap char wm geom . {} update +set bw [.t cget -borderwidth] +set px [.t cget -padx] +set py [.t cget -pady] +set hlth [.t cget -highlightthickness] test textDisp-4.7 {UpdateDisplayInfo, filling in extra vertical space} { # This test was failing on Windows because the title bar on . # was a certain minimum size and it was interfering with the size @@ -653,7 +657,7 @@ test textDisp-4.9 {UpdateDisplayInfo, filling in extra vertical space} {textfont update .t delete 15.0 end list [.t bbox 7.0] [.t bbox 12.0] -} [list [list 3 [expr {2*$fixedDiff + 14}] 7 $fixedHeight] [list 3 [expr {7*$fixedDiff + 79}] 7 $fixedHeight]] +} [list [list [expr {$hlth + $px + $bw}] [expr {$hlth + $py + $bw + $fixedHeight}] $fixedWidth $fixedHeight] [list [expr {$hlth + $px + $bw}] [expr {$hlth + $py + $bw + 6 * $fixedHeight}] $fixedWidth $fixedHeight]] test textDisp-4.10 {UpdateDisplayInfo, filling in extra vertical space} { .t delete 1.0 end .t insert end "1\n2\n3\n4\n5\nLine 6 is such a long line that it wraps around.\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17" -- cgit v0.12 From 47ca3a5ac9ec9e2f21a3efeb9bb4bda85526a3e7 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 3 Aug 2015 23:40:28 +0000 Subject: Fix [6fe75131c546226b]: doc: tk_messageBox (mac) --- doc/messageBox.n | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/doc/messageBox.n b/doc/messageBox.n index bbeffee..5ce1745 100644 --- a/doc/messageBox.n +++ b/doc/messageBox.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH tk_messageBox n 4.2 Tk "Tk Built-In Commands" .so man.macros .BS @@ -13,7 +13,6 @@ tk_messageBox \- pops up a message window and waits for user response. .SH SYNOPSIS \fBtk_messageBox \fR?\fIoption value ...\fR? .BE - .SH DESCRIPTION .PP This procedure creates and displays a message window with an @@ -22,70 +21,84 @@ the buttons in the message window is identified by a unique symbolic name (see the \fB\-type\fR options). After the message window is popped up, \fBtk_messageBox\fR waits for the user to select one of the buttons. Then it returns the symbolic name of the selected button. - +.PP The following option-value pairs are supported: .TP \fB\-default\fR \fIname\fR +. \fIName\fR gives the symbolic name of the default button for this message window ( .QW ok , .QW cancel , -and so on). See \fB\-type\fR +and so on). See \fB\-type\fR for a list of the symbolic names. If this option is not specified, the first button in the dialog will be made the default. .TP \fB\-detail\fR \fIstring\fR -.VS 8.5 +. Specifies an auxiliary message to the main message given by the -\fB\-message\fR option. Where supported by the underlying OS, the -message detail will be presented in a less emphasized font than the +\fB\-message\fR option. The message detail will be presented beneath the main +message and, where supported by the OS, in a less emphasized font than the main message. -.VE 8.5 .TP \fB\-icon\fR \fIiconImage\fR +. Specifies an icon to display. \fIIconImage\fR must be one of the following: \fBerror\fR, \fBinfo\fR, \fBquestion\fR or \fBwarning\fR. If this option is not specified, then the info icon will be displayed. .TP \fB\-message\fR \fIstring\fR -Specifies the message to display in this message box. +. +Specifies the message to display in this message box. The +default value is an empty string. .TP \fB\-parent\fR \fIwindow\fR +. Makes \fIwindow\fR the logical parent of the message box. The message box is displayed on top of its parent window. .TP \fB\-title\fR \fItitleString\fR -Specifies a string to display as the title of the message box. The -default value is an empty string. +. +Specifies a string to display as the title of the message box. This option +is ignored on Mac OS X, where platform guidelines forbid the use of a title +on this kind of dialog. .TP \fB\-type\fR \fIpredefinedType\fR +. Arranges for a predefined set of buttons to be displayed. The following values are possible for \fIpredefinedType\fR: .RS .TP 18 \fBabortretryignore\fR +. Displays three buttons whose symbolic names are \fBabort\fR, \fBretry\fR and \fBignore\fR. .TP 18 \fBok\fR +. Displays one button whose symbolic name is \fBok\fR. .TP 18 \fBokcancel\fR +. Displays two buttons whose symbolic names are \fBok\fR and \fBcancel\fR. .TP 18 \fBretrycancel\fR +. Displays two buttons whose symbolic names are \fBretry\fR and \fBcancel\fR. .TP 18 \fByesno\fR +. Displays two buttons whose symbolic names are \fByes\fR and \fBno\fR. .TP 18 \fByesnocancel\fR +. Displays three buttons whose symbolic names are \fByes\fR, \fBno\fR and \fBcancel\fR. .RE .PP .SH EXAMPLE +.PP .CS set answer [\fBtk_messageBox\fR \-message "Really quit?" \e \-icon question \-type yesno \e @@ -96,6 +109,8 @@ switch \-\- $answer { \-type ok} } .CE - .SH KEYWORDS message box +'\" Local Variables: +'\" mode: nroff +'\" End: -- cgit v0.12 From 1fd576b1cecb84450f2ae58edd48d66fe871c773 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 20 Aug 2015 14:13:25 +0000 Subject: Fix [http://core.tcl.tk/tcl/info/00189c4afcb9e2586301d711f71383e48817a72d|00189c4afc]: Allow semi-static UCRT build on Windows with VC 14.0 --- win/makefile.vc | 24 ++++++++++++++++++++++-- win/rules.vc | 7 +++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/win/makefile.vc b/win/makefile.vc index 4b9475f..dff7294 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -76,7 +76,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,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 @@ 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). +# 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 @@ -456,7 +461,13 @@ cdebug = -Zi -WX $(DEBUGFLAGS) 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 @@ -496,6 +507,10 @@ lflags = -nologo -machine:$(MACHINE) $(LINKERFLAGS) $(ldebug) lflags = $(lflags) -profile !endif +!if $(UCRT) && !($(DEBUG) && !$(UNCHECKED)) +lflags = $(lflags) -nodefaultlib:libucrt.lib +!endif + !if $(ALIGN98_HACK) && !$(STATIC_BUILD) ### Align sections for PE size savings. lflags = $(lflags) -opt:nowin98 @@ -520,6 +535,11 @@ baselibs = kernel32.lib user32.lib baselibs = $(baselibs) bufferoverflowU.lib !endif !endif + +!if $(UCRT) && !($(DEBUG) && !$(UNCHECKED)) +baselibs = $(baselibs) ucrt.lib +!endif + guilibs = $(baselibs) gdi32.lib diff --git a/win/rules.vc b/win/rules.vc index a43fac6..93c450b 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -223,6 +223,7 @@ LOIMPACT = 0 TCL_USE_STATIC_PACKAGES = 0 USE_THREAD_ALLOC = 0 UNCHECKED = 0 +UCRT = 0 !else !if [nmakehlp -f $(OPTS) "static"] !message *** Doing static @@ -302,6 +303,12 @@ UNCHECKED = 1 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. -- cgit v0.12 From 43fa4c24905499a1f9e52986e3bcc75e2ede53fb Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 28 Aug 2015 11:43:26 +0000 Subject: Completing [http://core.tcl.tk/tcl/info/00189c4afcb9e2586301d711f71383e48817a72d|00189c4afc]: Allow semi-static UCRT build on Windows with VC 14.0. Now for the configure/makefile build. --- win/configure | 20 ++++++++++++++++++-- win/makefile.vc | 25 +++++++------------------ win/rules.vc | 7 ------- win/tcl.m4 | 20 ++++++++++++++++++-- 4 files changed, 43 insertions(+), 29 deletions(-) diff --git a/win/configure b/win/configure index 35f57ca..57e0453 100755 --- a/win/configure +++ b/win/configure @@ -3827,6 +3827,13 @@ echo "${ECHO_T}using shared flags" >&6 EXESUFFIX="\${DBGX}.exe" LIBRARIES="\${SHARED_LIBRARIES}" SHLIB_LD_LIBS='${LIBS}' + case "x`echo \${VisualStudioVersion}`" in + x14*) + lflags="${lflags} -nodefaultlib:libucrt.lib" + ;; + *) + ;; + esac fi # DLLSUFFIX is separate because it is the building block for # users of tclConfig.sh that may build shared or static. @@ -3864,6 +3871,15 @@ echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 fi LIBS="user32.lib advapi32.lib ws2_32.lib" + + case "x`echo \${VisualStudioVersion}`" in + x14*) + LIBS="$LIBS ucrt.lib" + ;; + *) + ;; + esac + if test "$do64bit" != "no" ; then # The space-based-path will work for the Makefile, but will # not work if AC_TRY_COMPILE is called. TEA has the @@ -3938,7 +3954,7 @@ fi CFLAGS_DEBUG="-nologo -Zi -Od ${runtime}d" # Do not use -O2 for Win64 - this has proved buggy in code gen. CFLAGS_OPTIMIZE="-nologo -O1 ${runtime}" - lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" + lflags="${lflags} -nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" LINKBIN="\"${PATH64}/link.exe\"" # Avoid 'unresolved external symbol __security_cookie' errors. # c.f. http://support.microsoft.com/?id=894573 @@ -3950,7 +3966,7 @@ fi CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d" # -O2 - create fast code (/Og /Oi /Ot /Oy /Ob2 /Gs /GF /Gy) CFLAGS_OPTIMIZE="-nologo -O2 ${runtime}" - lflags="-nologo" + lflags="${lflags} -nologo" LINKBIN="link" fi diff --git a/win/makefile.vc b/win/makefile.vc index dff7294..d2795c9 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -42,7 +42,7 @@ the build instructions. # turn on the 64-bit compiler, if your SDK has it. # # 3) Targets are: -# release -- Builds the core, the shell. (default) +# release -- Builds the core, the shell and the dlls. (default) # dlls -- Just builds the windows extensions. # shell -- Just builds the shell and the core. # core -- Only builds the core [tkXX.(dll|lib)]. @@ -76,7 +76,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,nothreads,noxp,pdbs,profile,square,static,staticpkg,symbols,unchecked,ucrt,none +# OPTS=loimpact,msvcrt,nothreads,noxp,pdbs,profile,square,static,staticpkg,symbols,unchecked,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,11 +105,6 @@ 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). -# 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 @@ -448,7 +443,7 @@ cdebug = $(OPTIMIZATIONS) cdebug = !endif !if $(SYMBOLS) -cdebug = $(cdebug) -Zi +cdebug = $(cdebug) -Zi !endif !else if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64" ### Warnings are too many, can't support warnings into errors. @@ -461,13 +456,7 @@ cdebug = -Zi -WX $(DEBUGFLAGS) cwarn = $(WARNINGS) -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE cflags = -nologo -c $(COMPILERFLAGS) $(cwarn) -Fp$(TMP_DIR)^\ -!if $(UCRT) -!if $(DEBUG) && !$(UNCHECKED) -crt = -MDd -!else -crt = -MT -!endif -!elseif $(MSVCRT) +!if $(MSVCRT) !if $(DEBUG) && !$(UNCHECKED) crt = -MDd !else @@ -487,6 +476,7 @@ CON_CFLAGS = $(cdebug) $(cflags) $(crt) -DCONSOLE WISH_CFLAGS = $(BASE_CFLAGS) $(TK_DEFINES) STUB_CFLAGS = $(cflags) $(cdebug) $(TK_DEFINES) + #--------------------------------------------------------------------- # Link flags #--------------------------------------------------------------------- @@ -507,7 +497,7 @@ lflags = -nologo -machine:$(MACHINE) $(LINKERFLAGS) $(ldebug) lflags = $(lflags) -profile !endif -!if $(UCRT) && !($(DEBUG) && !$(UNCHECKED)) +!if $(MSVCRT) && !($(DEBUG) && !$(UNCHECKED)) && $(VCVERSION) >= 1900 lflags = $(lflags) -nodefaultlib:libucrt.lib !endif @@ -535,8 +525,7 @@ baselibs = kernel32.lib user32.lib baselibs = $(baselibs) bufferoverflowU.lib !endif !endif - -!if $(UCRT) && !($(DEBUG) && !$(UNCHECKED)) +!if $(MSVCRT) && !($(DEBUG) && !$(UNCHECKED)) && $(VCVERSION) >= 1900 baselibs = $(baselibs) ucrt.lib !endif diff --git a/win/rules.vc b/win/rules.vc index 93c450b..a43fac6 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -223,7 +223,6 @@ LOIMPACT = 0 TCL_USE_STATIC_PACKAGES = 0 USE_THREAD_ALLOC = 0 UNCHECKED = 0 -UCRT = 0 !else !if [nmakehlp -f $(OPTS) "static"] !message *** Doing static @@ -303,12 +302,6 @@ UNCHECKED = 1 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. diff --git a/win/tcl.m4 b/win/tcl.m4 index 44fd47e..6f10a96 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -783,6 +783,13 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ EXESUFFIX="\${DBGX}.exe" LIBRARIES="\${SHARED_LIBRARIES}" SHLIB_LD_LIBS='${LIBS}' + case "x`echo \${VisualStudioVersion}`" in + x14*) + lflags="${lflags} -nodefaultlib:libucrt.lib" + ;; + *) + ;; + esac fi # DLLSUFFIX is separate because it is the building block for # users of tclConfig.sh that may build shared or static. @@ -817,6 +824,15 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ fi LIBS="user32.lib advapi32.lib ws2_32.lib" + + case "x`echo \${VisualStudioVersion}`" in + x14*) + LIBS="$LIBS ucrt.lib" + ;; + *) + ;; + esac + if test "$do64bit" != "no" ; then # The space-based-path will work for the Makefile, but will # not work if AC_TRY_COMPILE is called. TEA has the @@ -831,7 +847,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ CFLAGS_DEBUG="-nologo -Zi -Od ${runtime}d" # Do not use -O2 for Win64 - this has proved buggy in code gen. CFLAGS_OPTIMIZE="-nologo -O1 ${runtime}" - lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" + lflags="${lflags} -nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" LINKBIN="\"${PATH64}/link.exe\"" # Avoid 'unresolved external symbol __security_cookie' errors. # c.f. http://support.microsoft.com/?id=894573 @@ -843,7 +859,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d" # -O2 - create fast code (/Og /Oi /Ot /Oy /Ob2 /Gs /GF /Gy) CFLAGS_OPTIMIZE="-nologo -O2 ${runtime}" - lflags="-nologo" + lflags="${lflags} -nologo" LINKBIN="link" fi -- cgit v0.12 From 7708c070940fa9d780429ace70c7643fb553872a Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 2 Sep 2015 20:27:57 +0000 Subject: Fixed bug [1581435fff] - Documented precedence order in the matching process of the index string --- doc/menu.n | 15 +++++++++------ tests/menu.test | 9 +++++++-- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/doc/menu.n b/doc/menu.n index 6d0dc8a..1c943f9 100644 --- a/doc/menu.n +++ b/doc/menu.n @@ -285,15 +285,10 @@ operations on the widget. It has the following general form: determine the exact behavior of the command. .PP Many of the widget commands for a menu take as one argument an -indicator of which entry of the menu to operate on. These +indicator of which entry of the menu to operate on. These indicators are called \fIindex\fRes and may be specified in any of the following forms: .TP 12 -\fInumber\fR -Specifies the entry numerically, where 0 corresponds -to the top-most entry of the menu, 1 to the entry below it, and -so on. -.TP 12 \fBactive\fR Indicates the entry that is currently active. If no entry is active then this form is equivalent to \fBnone\fR. This form may @@ -323,6 +318,11 @@ For example, .QW \fB@0\fR indicates the top-most entry in the window. .TP 12 +\fInumber\fR +Specifies the entry numerically, where 0 corresponds +to the top-most entry of the menu, 1 to the entry below it, and +so on. +.TP 12 \fIpattern\fR If the index does not satisfy one of the above forms then this form is used. \fIPattern\fR is pattern-matched against the label of @@ -330,6 +330,9 @@ each entry in the menu, in order from the top down, until a matching entry is found. The rules of \fBTcl_StringMatch\fR are used. .PP +If the index could match more than one of the above forms, then +the form earlier in the above list takes precedence. +.PP The following widget commands are possible for menu widgets: .TP \fIpathName \fBactivate \fIindex\fR diff --git a/tests/menu.test b/tests/menu.test index 3cb47c3..cfe00b9 100644 --- a/tests/menu.test +++ b/tests/menu.test @@ -754,8 +754,13 @@ test menu-3.41 {MenuWidgetCmd procedure, "index" option} { catch {destroy .m1} menu .m1 .m1 add command -label "test" - list [catch {.m1 index "test"} msg] $msg [destroy .m1] -} {0 1 {}} + .m1 add command -label "3" + .m1 add command -label "another label" + .m1 add command -label "end" + .m1 add command -label "3a" + .m1 add command -label "final entry" + list [.m1 index "test"] [.m1 index "3"] [.m1 index "3a"] [.m1 index "end"] [destroy .m1] +} {1 3 5 6 {}} test menu-3.42 {MenuWidgetCmd procedure, "insert" option} { catch {destroy .m1} menu .m1 -- cgit v0.12 From 4b62f1fb163792e9cc42e12ee5e803ae187cb609 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 13 Sep 2015 12:37:10 +0000 Subject: Bug [cc0ba31920] - Make text-9.2.46 pass on Windows 8.1 --- tests/text.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/text.test b/tests/text.test index 53196be..fa00ce3 100644 --- a/tests/text.test +++ b/tests/text.test @@ -726,7 +726,7 @@ test text-9.2.46 {TextWidgetCmd procedure, "count" option} -setup { .mytop.t insert end "Line $i+++Line $i---Line $i///Line $i - This is Line [format %c [expr 64+$i]]\n" } .mytop.t tag configure hidden -elide true - .mytop.t tag add hidden 2.15 3.10 + .mytop.t tag add hidden 2.20 3.10 .mytop.t configure -wrap char lappend res [.mytop.t count -displaylines 2.0 3.0] lappend res [.mytop.t count -displaylines 2.0 3.40] -- cgit v0.12