From 247529b2e2220a8d411a33788f9e7be3828d12a6 Mon Sep 17 00:00:00 2001 From: Joe Mistachkin Date: Thu, 14 Jan 2016 23:55:45 +0000 Subject: Add the tcl_platform(engine) element, TIP to be written. --- generic/tclBasic.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 5c5bc64..0bb43cc 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -916,6 +916,13 @@ Tcl_CreateInterp(void) TclInitEmbeddedConfigurationInformation(interp); /* + * TIP #XXX: Declare the name of the script engine to be "Tcl". + */ + + Tcl_SetVar2(interp, "tcl_platform", "engine", "Tcl", + TCL_GLOBAL_ONLY); + + /* * Compute the byte order of this machine. */ -- cgit v0.12 From 4320d2b7859b143036f361013d5eaa7d0baaa5c8 Mon Sep 17 00:00:00 2001 From: Joe Mistachkin Date: Fri, 15 Jan 2016 00:39:41 +0000 Subject: Add docs and tests. --- doc/tclvars.n | 5 +++++ tests/platform.test | 6 +++++- tests/safe.test | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/tclvars.n b/doc/tclvars.n index a8fba47..a256c21 100644 --- a/doc/tclvars.n +++ b/doc/tclvars.n @@ -299,6 +299,11 @@ so extension writers can specify which package to load depending on the C run-time library that is in use. This is not an indication that this core contains symbols. .TP +\fBengine\fR +. +The name of the Tcl language implementation. When the interpreter is first +created, this is always set to the string \fBTcl\fR. +.TP \fBmachine\fR . The instruction set executed by this machine, such as diff --git a/tests/platform.test b/tests/platform.test index cc00d49..c826444 100644 --- a/tests/platform.test +++ b/tests/platform.test @@ -23,6 +23,10 @@ catch [list package require -exact Tcltest [info patchlevel]] testConstraint testCPUID [llength [info commands testcpuid]] +test platform-1.0 {tcl_platform(engine)} { + set tcl_platform(engine) +} {Tcl} + test platform-1.1 {TclpSetVariables: tcl_platform} { interp create i i eval {catch {unset tcl_platform(debug)}} @@ -30,7 +34,7 @@ test platform-1.1 {TclpSetVariables: tcl_platform} { set result [i eval {lsort [array names tcl_platform]}] interp delete i set result -} {byteOrder machine os osVersion pathSeparator platform pointerSize user wordSize} +} {byteOrder engine machine os osVersion pathSeparator platform pointerSize user wordSize} # Test assumes twos-complement arithmetic, which is true of virtually # everything these days. Note that this does *not* use wide(), and diff --git a/tests/safe.test b/tests/safe.test index 859f352..94c1755 100644 --- a/tests/safe.test +++ b/tests/safe.test @@ -174,7 +174,7 @@ test safe-6.3 {test safe interpreters knowledge of the world} { } set r [lsearch -all -inline -not -exact $r "threaded"] lsort $r -} {byteOrder pathSeparator platform pointerSize wordSize} +} {byteOrder engine pathSeparator platform pointerSize wordSize} # More test should be added to check that hostname, nameofexecutable, aren't # leaking infos, but they still do... -- cgit v0.12 From 28d25fa6cf8d801e60d1d41099179e356ef8ecae Mon Sep 17 00:00:00 2001 From: Joe Mistachkin Date: Tue, 19 Jan 2016 17:48:25 +0000 Subject: Update comment with TIP number. --- generic/tclBasic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 0bb43cc..e5d7406 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -916,7 +916,7 @@ Tcl_CreateInterp(void) TclInitEmbeddedConfigurationInformation(interp); /* - * TIP #XXX: Declare the name of the script engine to be "Tcl". + * TIP #440: Declare the name of the script engine to be "Tcl". */ Tcl_SetVar2(interp, "tcl_platform", "engine", "Tcl", -- cgit v0.12 From 3fa3e3b2d59022f67a190c83e215f789ce836e2e Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 29 Jan 2016 09:46:56 +0000 Subject: Fix gcc'ism. Not all compilers can substract two void pointers. --- generic/tclTest.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/generic/tclTest.c b/generic/tclTest.c index 63a6740..9794f59 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -6872,9 +6872,9 @@ NREUnwind_callback( &none, NULL); } else { Tcl_Obj *idata[3]; - idata[0] = Tcl_NewIntObj((int) (data[1] - data[0])); - idata[1] = Tcl_NewIntObj((int) (data[2] - data[0])); - idata[2] = Tcl_NewIntObj((int) ((void *) &none - data[0])); + idata[0] = Tcl_NewIntObj((int) ((char *) data[1] - (char *) data[0])); + idata[1] = Tcl_NewIntObj((int) ((char *) data[2] - (char *) data[0])); + idata[2] = Tcl_NewIntObj((int) ((char *) &none - (char *) data[0])); Tcl_SetObjResult(interp, Tcl_NewListObj(3, idata)); } return TCL_OK; -- cgit v0.12