Tcl Source Code

Changes On Branch tclPlatformEngine
Login
Bounty program for improvements to Tcl and certain Tcl packages.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch tclPlatformEngine Excluding Merge-Ins

This is equivalent to a diff from 021e073bf0 to c0f8a3d729

2016-01-29
13:35
Implement TIP #440: Add engine to tcl_platform Array check-in: 797fd8bdc2 user: jan.nijtmans tags: trunk
2016-01-19
17:48
Update comment with TIP number. Closed-Leaf check-in: c0f8a3d729 user: mistachkin tags: tip-440, tclPlatformEngine
2016-01-18
10:16
Put the file location information that Tcl has into the disassembled code. Important for tclquadcode... check-in: 7547bd6702 user: dkf tags: trunk
2016-01-15
00:39
Add docs and tests. check-in: 767fb963f3 user: mistachkin tags: tip-440, tclPlatformEngine
2016-01-14
23:55
Add the tcl_platform(engine) element, TIP to be written. check-in: 1d66076dc4 user: mistachkin tags: tip-440, tclPlatformEngine
2016-01-09
23:02
Merge trunk. Update documentation check-in: 2b101690e0 user: jan.nijtmans tags: zipfs
2016-01-08
14:48
merge trunk check-in: efa992a355 user: dgp tags: bug-593baa032c
2016-01-07
11:33
Fix [f01d74dc8c]: DEFAULT_COPY_BLOCK_SIZE has incorrect value check-in: 021e073bf0 user: jan.nijtmans tags: trunk
2016-01-06
11:15
Fix win32 mingw 32-bit build, bug was introduced by [c397433be321e6d9] (wrong zlib1.dll was copied) check-in: fae4d82205 user: jan.nijtmans tags: trunk

Changes to doc/tclvars.n.

295
296
297
298
299
300
301





302
303
304
305
306
307
308
.
If this variable exists, then the interpreter was compiled with and linked
to a debug-enabled C run-time.  This variable will only exist on Windows,
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





\fBmachine\fR
.
The instruction set executed by this machine, such as
\fBintel\fR, \fBPPC\fR, \fB68k\fR, or \fBsun4m\fR.  On UNIX machines, this
is the value returned by \fBuname -m\fR.
.TP
\fBos\fR






>
>
>
>
>







295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
.
If this variable exists, then the interpreter was compiled with and linked
to a debug-enabled C run-time.  This variable will only exist on Windows,
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
is the value returned by \fBuname -m\fR.
.TP
\fBos\fR

Changes to generic/tclBasic.c.

911
912
913
914
915
916
917







918
919
920
921
922
923
924
    /*
     * TIP #59: Make embedded configuration information available.
     */

    TclInitEmbeddedConfigurationInformation(interp);








    /*
     * Compute the byte order of this machine.
     */

    order.s = 1;
    Tcl_SetVar2(interp, "tcl_platform", "byteOrder",
	    ((order.c[0] == 1) ? "littleEndian" : "bigEndian"),






>
>
>
>
>
>
>







911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
    /*
     * TIP #59: Make embedded configuration information available.
     */

    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.
     */

    order.s = 1;
    Tcl_SetVar2(interp, "tcl_platform", "byteOrder",
	    ((order.c[0] == 1) ? "littleEndian" : "bigEndian"),

Changes to tests/platform.test.

18
19
20
21
22
23
24




25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
    variable ::tcl_platform

::tcltest::loadTestedCommands
catch [list package require -exact Tcltest [info patchlevel]]

testConstraint testCPUID [llength [info commands testcpuid]]





test platform-1.1 {TclpSetVariables: tcl_platform} {
    interp create i
    i eval {catch {unset tcl_platform(debug)}}
    i eval {catch {unset tcl_platform(threaded)}}
    set result [i eval {lsort [array names tcl_platform]}]
    interp delete i
    set result
} {byteOrder 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
# this is intentional since that could make Tcl's numbers wider than
# the machine-integer on some platforms...
test platform-2.1 {tcl_platform(wordSize) indicates size of native word} {
    set result [expr {int(1 << (8 * $tcl_platform(wordSize) - 1))}]






>
>
>
>








|







18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
    variable ::tcl_platform

::tcltest::loadTestedCommands
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)}}
    i eval {catch {unset tcl_platform(threaded)}}
    set result [i eval {lsort [array names tcl_platform]}]
    interp delete i
    set result
} {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
# this is intentional since that could make Tcl's numbers wider than
# the machine-integer on some platforms...
test platform-2.1 {tcl_platform(wordSize) indicates size of native word} {
    set result [expr {int(1 << (8 * $tcl_platform(wordSize) - 1))}]

Changes to tests/safe.test.

170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
    set r [SafeEval {array names tcl_platform}]
    # If running a windows-debug shell, remove the "debug" element from r.
    if {[testConstraint win]} {
	set r [lsearch -all -inline -not -exact $r "debug"]
    }
    set r [lsearch -all -inline -not -exact $r "threaded"]
    lsort $r
} {byteOrder pathSeparator platform pointerSize wordSize}

# More test should be added to check that hostname, nameofexecutable, aren't
# leaking infos, but they still do...

# high level general test
test safe-7.1 {tests that everything works at high level} {
    set i [safe::interpCreate]






|







170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
    set r [SafeEval {array names tcl_platform}]
    # If running a windows-debug shell, remove the "debug" element from r.
    if {[testConstraint win]} {
	set r [lsearch -all -inline -not -exact $r "debug"]
    }
    set r [lsearch -all -inline -not -exact $r "threaded"]
    lsort $r
} {byteOrder engine pathSeparator platform pointerSize wordSize}

# More test should be added to check that hostname, nameofexecutable, aren't
# leaking infos, but they still do...

# high level general test
test safe-7.1 {tests that everything works at high level} {
    set i [safe::interpCreate]