Compare commits

...
Author SHA1 Message Date
Joe Mistachkin 8bc3697d12 Backport of TIP #440. 2016-01-21 06:11:02 +00:00
4 changed files with 18 additions and 2 deletions
+5
View File
@@ -254,6 +254,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
\fBintel\fR, \fBPPC\fR, \fB68k\fR, or \fBsun4m\fR. On UNIX machines, this
+7
View File
@@ -789,6 +789,13 @@ Tcl_CreateInterp(void)
TclInitEmbeddedConfigurationInformation(interp);
/*
* TIP #440: 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.
*/
+5 -1
View File
@@ -20,6 +20,10 @@ namespace eval ::tcl::test::platform {
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)}}
@@ -27,7 +31,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 platform pointerSize user wordSize}
} {byteOrder engine machine os osVersion 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
+1 -1
View File
@@ -166,7 +166,7 @@ test safe-6.3 {test safe interpreters knowledge of the world} {
set r [lreplace $r $threaded $threaded]
}
set r
} {byteOrder platform pointerSize wordSize}
} {byteOrder engine platform pointerSize wordSize}
# more test should be added to check that hostname, nameofexecutable,
# aren't leaking infos, but they still do...