diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-09-27 11:42:12 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-09-27 11:42:12 (GMT) |
commit | e0087267dfcc2f5340cb0ca19d97f65ae198beb0 (patch) | |
tree | 0678341be2d455b1e33e3e1f29b6d92fc7d99efd | |
parent | a2bc74984c84ac28c1f9116c73ee22b237f36539 (diff) | |
parent | 052144cb1fd693cf17ac2ebdf15272268d16a57d (diff) | |
download | tcl-e0087267dfcc2f5340cb0ca19d97f65ae198beb0.zip tcl-e0087267dfcc2f5340cb0ca19d97f65ae198beb0.tar.gz tcl-e0087267dfcc2f5340cb0ca19d97f65ae198beb0.tar.bz2 |
Merge 8.6 and fix Travis build on Windows
-rw-r--r-- | generic/tclMain.c | 37 | ||||
-rw-r--r-- | tests/compile.test | 6 | ||||
-rw-r--r-- | win/Makefile.in | 4 | ||||
-rw-r--r-- | win/makefile.vc | 4 |
4 files changed, 22 insertions, 29 deletions
diff --git a/generic/tclMain.c b/generic/tclMain.c index 3423e29..08c1fe0 100644 --- a/generic/tclMain.c +++ b/generic/tclMain.c @@ -43,26 +43,19 @@ # define _tcscmp strcmp #endif -/* - * Further on, in UNICODE mode we just use Tcl_NewUnicodeObj, otherwise - * NewNativeObj is needed (which provides proper conversion from native - * encoding to UTF-8). - */ - -#ifdef UNICODE -# define NewNativeObj Tcl_NewUnicodeObj -#else /* !UNICODE */ static inline Tcl_Obj * NewNativeObj( - char *string, - int length) + TCHAR *string) { Tcl_DString ds; - Tcl_ExternalToUtfDString(NULL, string, length, &ds); +#ifdef UNICODE + Tcl_WinTCharToUtf(string, -1, &ds); +#else + Tcl_ExternalToUtfDString(NULL, (char *) string, -1, &ds); +#endif return TclDStringToObj(&ds); } -#endif /* !UNICODE */ /* * Declarations for various library functions and variables (don't want to @@ -124,7 +117,7 @@ static void Prompt(Tcl_Interp *interp, InteractiveState *isPtr); static void StdinProc(ClientData clientData, int mask); static void FreeMainInterp(ClientData clientData); -#ifndef UNKCODE +#if !defined(_WIN32) || defined(UNICODE) static Tcl_ThreadDataKey dataKey; /* @@ -269,7 +262,7 @@ Tcl_SourceRCFile( Tcl_DStringFree(&temp); } } -#endif /* !UNKCODE */ +#endif /* !UNICODE */ /*---------------------------------------------------------------------- * @@ -331,14 +324,14 @@ Tcl_MainEx( if ((argc > 3) && (0 == _tcscmp(TEXT("-encoding"), argv[1])) && ('-' != argv[3][0])) { - Tcl_Obj *value = NewNativeObj(argv[2], -1); - Tcl_SetStartupScript(NewNativeObj(argv[3], -1), + Tcl_Obj *value = NewNativeObj(argv[2]); + Tcl_SetStartupScript(NewNativeObj(argv[3]), Tcl_GetString(value)); Tcl_DecrRefCount(value); argc -= 3; argv += 3; } else if ((argc > 1) && ('-' != argv[1][0])) { - Tcl_SetStartupScript(NewNativeObj(argv[1], -1), NULL); + Tcl_SetStartupScript(NewNativeObj(argv[1]), NULL); argc--; argv++; } @@ -346,7 +339,7 @@ Tcl_MainEx( path = Tcl_GetStartupScript(&encodingName); if (path == NULL) { - appName = NewNativeObj(argv[0], -1); + appName = NewNativeObj(argv[0]); } else { appName = path; } @@ -358,7 +351,7 @@ Tcl_MainEx( argvPtr = Tcl_NewListObj(0, NULL); while (argc--) { - Tcl_ListObjAppendElement(NULL, argvPtr, NewNativeObj(*argv++, -1)); + Tcl_ListObjAppendElement(NULL, argvPtr, NewNativeObj(*argv++)); } Tcl_SetVar2Ex(interp, "argv", NULL, argvPtr, TCL_GLOBAL_ONLY); @@ -640,7 +633,7 @@ Tcl_Main( } #endif /* TCL_MAJOR_VERSION == 8 && !UNICODE */ -#ifndef UNKCODE +#if !defined(_WIN32) || defined(UNICODE) /* *--------------------------------------------------------------- @@ -731,7 +724,7 @@ TclFullFinalizationRequested(void) return finalize; #endif /* PURIFY */ } -#endif /* !UNKCODE */ +#endif /* UNICODE */ /* *---------------------------------------------------------------------- diff --git a/tests/compile.test b/tests/compile.test index 0a29c15..cb41063 100644 --- a/tests/compile.test +++ b/tests/compile.test @@ -494,10 +494,10 @@ test compile-13.2 {TclCompileScript: testing expected nested scripts compilation ti eval {set result {}} } -body { # Test different compilation variants (instructions evalStk, invokeStk, etc), - # with 2000 (1000 in debug) nested scripts (bodies). If you get SO/SF exceptions on some low-stack + # with 1500 (1000 in debug) nested scripts (bodies). If you get SO/SF exceptions on some low-stack # boxes or systems, please don't decrease it (either provide a constraint) ti eval {foreach cmd {eval "if 1" try catch} { - set c [gencode [expr {![::tcl::pkgconfig get debug] ? 2000 : 1000}] $cmd] + set c [gencode [expr {![::tcl::pkgconfig get debug] ? 1500 : 1000}] $cmd] if 1 $c }} ti eval {set result} @@ -511,7 +511,7 @@ test compile-13.3 {TclCompileScript: testing check of max depth by nested script # with 500 nested scripts (bodies). It must generate "too many nested compilations" # error for any variant we're testing here: ti eval {foreach cmd {eval "if 1" try catch} { - set c [gencode [expr {![info exists ::tcl_platform(debug)] ? 2000 : 1000}] $cmd] + set c [gencode 500 $cmd] lappend errors [catch $c e] $e }} #puts $errors diff --git a/win/Makefile.in b/win/Makefile.in index e3d26a8..4b2aed2 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -270,8 +270,8 @@ GENERIC_OBJS = \ tclLiteral.$(OBJEXT) \ tclListObj.$(OBJEXT) \ tclLoad.$(OBJEXT) \ + tclMainW.$(OBJEXT) \ tclMain.$(OBJEXT) \ - tclMain2.$(OBJEXT) \ tclNamesp.$(OBJEXT) \ tclNotify.$(OBJEXT) \ tclOO.$(OBJEXT) \ @@ -551,7 +551,7 @@ tclWinDde.${OBJEXT}: tclWinDde.c tclAppInit.${OBJEXT}: tclAppInit.c $(CC) -c $(CC_SWITCHES) $(EXTFLAGS) -DUNICODE -D_UNICODE @DEPARG@ $(CC_OBJNAME) -tclMain2.${OBJEXT}: tclMain.c +tclMainW.${OBJEXT}: tclMain.c $(CC) -c $(CC_SWITCHES) -DBUILD_tcl -DUNICODE -D_UNICODE @DEPARG@ $(CC_OBJNAME) # TIP #59, embedding of configuration information into the binary library. diff --git a/win/makefile.vc b/win/makefile.vc index 52f63f6..21e4270 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -260,8 +260,8 @@ COREOBJS = \ $(TMP_DIR)\tclListObj.obj \
$(TMP_DIR)\tclLiteral.obj \
$(TMP_DIR)\tclLoad.obj \
+ $(TMP_DIR)\tclMainW.obj \
$(TMP_DIR)\tclMain.obj \
- $(TMP_DIR)\tclMain2.obj \
$(TMP_DIR)\tclNamesp.obj \
$(TMP_DIR)\tclNotify.obj \
$(TMP_DIR)\tclOO.obj \
@@ -737,7 +737,7 @@ $(TMP_DIR)\testMain.obj: $(WIN_DIR)\tclAppInit.c /DTCL_USE_STATIC_PACKAGES=$(TCL_USE_STATIC_PACKAGES) \
-Fo$@ $?
-$(TMP_DIR)\tclMain2.obj: $(GENERICDIR)\tclMain.c
+$(TMP_DIR)\tclMainW.obj: $(GENERICDIR)\tclMain.c
$(cc32) $(pkgcflags) /DUNICODE /D_UNICODE \
-Fo$@ $?
|