Check-in [256b0d9584]
Not logged in

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

Overview
Comment:merge
Timelines: family | ancestors | descendants | both | dgp-refactor
Files: files | file ages | folders
SHA1: 256b0d958475450b4c6565445d2b4ab6105aaf01
User & Date: dgp 2010-04-19 15:58:51.000
Context
2010-04-21
14:23
merge check-in: 20fa5b15d7 user: dgp tags: dgp-refactor
2010-04-19
15:58
merge check-in: 256b0d9584 user: dgp tags: dgp-refactor
2010-04-09
02:05
merge check-in: 8799d8f95f user: dgp tags: dgp-refactor
Changes
Unified Diff Ignore Whitespace Patch
Changes to ChangeLog.




































1
2
3
4
5
6
7




































2010-04-08  Donal K. Fellows  <dkf@users.sf.net>

	* generic/tclCompCmdsSZ.c (TclSubstCompile): If the first token does
	not result in a *guaranteed* push of a Tcl_Obj on the stack, we must
	push an empty object. Otherwise it is possible to get to a 'concat1'
	or 'done' without enough values on the stack, resulting in a crash.
	Thanks to Joe Mistachkin for identifying a script that could trigger
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
2010-04-19  Donal K. Fellows  <dkf@users.sf.net>

	* generic/tclExecute.c (TclExecuteByteCode): Improve commenting and
	reduce indentation for the Invocation Block.

2010-04-18  Donal K. Fellows  <dkf@users.sf.net>

	* doc/unset.n: [Bug 2988940]: Fix typo.

2010-04-15  Jan Nijtmans  <nijtmans@users.sf.net>

	* win/tclWinPort.h:       Move inclusion of <tchar.h> from
	* generic/tcl.h:          tclPlatDecls.h to tclWinPort.h, where it
	* generic/tclPlatDecls.h: belongs. Add fallback in tcl.h, so TCHAR is
				  available in win32 always.

2010-04-15  Donal K. Fellows  <dkf@users.sf.net>

	* doc/try.n: [Bug 2987551]: Fix typo.

2010-04-14  Andreas Kupries  <andreask@activestate.com>

	* library/platform/platform.tcl: Linux platform identification:
	* library/platform/pkgIndex.tcl: Check /lib64 for existence of files
	* unix/Makefile.in: matching libc* before accepting it as base
	* win/Makefile.in:  directory. This can happen on weirdly installed
	32bit systems which have an empty or partially filled /lib64 without
	an actual libc. Bumped to version 1.0.6.

2010-04-13  Jan Nijtmans  <nijtmans@users.sf.net>

	* win/tclWinPort.h: Fix [Patch 2986105]: conditionally defining
	* win/tclWinFile.c: strcasecmp/strncasecmp
	* win/tclWinLoad.c: Fix gcc warning: comparison of unsigned expression
	>= 0 is always true

2010-04-08  Donal K. Fellows  <dkf@users.sf.net>

	* generic/tclCompCmdsSZ.c (TclSubstCompile): If the first token does
	not result in a *guaranteed* push of a Tcl_Obj on the stack, we must
	push an empty object. Otherwise it is possible to get to a 'concat1'
	or 'done' without enough values on the stack, resulting in a crash.
	Thanks to Joe Mistachkin for identifying a script that could trigger
Changes to doc/try.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
'\"
'\" Copyright (c) 2008 Donal K. Fellows
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" 
'\" RCS: @(#) $Id: try.n,v 1.1.2.3 2009/10/19 22:13:55 dgp Exp $
'\" 
.so man.macros
.TH try n 8.6 Tcl "Tcl Built-In Commands"
.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
try \- Trap and process errors and exceptions






|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
'\"
'\" Copyright (c) 2008 Donal K. Fellows
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" 
'\" RCS: @(#) $Id: try.n,v 1.1.2.4 2010/04/19 15:58:51 dgp Exp $
'\" 
.so man.macros
.TH try n 8.6 Tcl "Tcl Built-In Commands"
.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
try \- Trap and process errors and exceptions
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
.PP
The \fIhandler\fR clauses are each expressed as several words, and must have
one of the following forms:
.TP
\fBon \fIcode variableList script\fR
.
This clause matches if the evaluation of \fIbody\fR completed with the
exeception code \fIcode\fR. The \fIcode\fR may be expressed as an integer or
one of the following literal words: \fBok\fR, \fBerror\fR, \fBreturn\fR,
\fBbreak\fR, or \fBcontinue\fR. Those literals correspond to the integers 0
through 4 respectively.
.TP
\fBtrap \fIpattern variableList script\fR
.
This clause matches if the evaluation of \fIbody\fR resulted in an error and







|







27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
.PP
The \fIhandler\fR clauses are each expressed as several words, and must have
one of the following forms:
.TP
\fBon \fIcode variableList script\fR
.
This clause matches if the evaluation of \fIbody\fR completed with the
exception code \fIcode\fR. The \fIcode\fR may be expressed as an integer or
one of the following literal words: \fBok\fR, \fBerror\fR, \fBreturn\fR,
\fBbreak\fR, or \fBcontinue\fR. Those literals correspond to the integers 0
through 4 respectively.
.TP
\fBtrap \fIpattern variableList script\fR
.
This clause matches if the evaluation of \fIbody\fR resulted in an error and
Changes to doc/unset.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\" Copyright (c) 2000 Ajuba Solutions.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" 
'\" RCS: @(#) $Id: unset.n,v 1.5.20.6 2008/10/17 20:52:23 dgp Exp $
'\" 
.so man.macros
.TH unset n 8.4 Tcl "Tcl Built-In Commands"
.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
unset \- Delete variables








|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\" Copyright (c) 2000 Ajuba Solutions.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" 
'\" RCS: @(#) $Id: unset.n,v 1.5.20.7 2010/04/19 15:58:51 dgp Exp $
'\" 
.so man.macros
.TH unset n 8.4 Tcl "Tcl Built-In Commands"
.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
unset \- Delete variables
28
29
30
31
32
33
34
35

36
37
38
39
40
41
42
index, then the entire array is deleted.
The \fBunset\fR command returns an empty string as result.
If \fI\-nocomplain\fR is specified as the first argument, any possible
errors are suppressed.  The option may not be abbreviated, in order to
disambiguate it from possible variable names.  The option \fI\-\-\fR
indicates the end of the options, and should be used if you wish to
remove a variable with the same name as any of the options.
If an error occurs, any variables after the named one causing the error not

deleted.  An error can occur when the named variable does not exist, or the
name refers to an array element but the variable is a scalar, or the name
refers to a variable in a non-existent namespace.
.SH EXAMPLE
.PP
Create an array containing a mapping from some numbers to their
squares and remove the array elements for non-prime numbers:







|
>







28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
index, then the entire array is deleted.
The \fBunset\fR command returns an empty string as result.
If \fI\-nocomplain\fR is specified as the first argument, any possible
errors are suppressed.  The option may not be abbreviated, in order to
disambiguate it from possible variable names.  The option \fI\-\-\fR
indicates the end of the options, and should be used if you wish to
remove a variable with the same name as any of the options.
If an error occurs during variable deletion, any variables after the named one
causing the error are not
deleted.  An error can occur when the named variable does not exist, or the
name refers to an array element but the variable is a scalar, or the name
refers to a variable in a non-existent namespace.
.SH EXAMPLE
.PP
Create an array containing a mapping from some numbers to their
squares and remove the array elements for non-prime numbers:
59
60
61
62
63
64
65




puts "The prime squares are:"
parray squares
.CE
.SH "SEE ALSO"
set(n), trace(n), upvar(n)
.SH KEYWORDS
remove, variable











>
>
>
>
60
61
62
63
64
65
66
67
68
69
70
puts "The prime squares are:"
parray squares
.CE
.SH "SEE ALSO"
set(n), trace(n), upvar(n)
.SH KEYWORDS
remove, variable
'\" Local Variables:
'\" mode: nroff
'\" fill-column: 78
'\" End:
Changes to generic/tcl.h.
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 * Copyright (c) 1994-1998 Sun Microsystems, Inc.
 * Copyright (c) 1998-2000 by Scriptics Corporation.
 * Copyright (c) 2002 by Kevin B. Kenny.  All rights reserved.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tcl.h,v 1.157.2.86 2010/02/17 15:36:53 dgp Exp $
 */

#ifndef _TCL
#define _TCL

/*
 * For C++ compilers, use extern "C"







|







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 * Copyright (c) 1994-1998 Sun Microsystems, Inc.
 * Copyright (c) 1998-2000 by Scriptics Corporation.
 * Copyright (c) 2002 by Kevin B. Kenny.  All rights reserved.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tcl.h,v 1.157.2.87 2010/04/19 15:58:51 dgp Exp $
 */

#ifndef _TCL
#define _TCL

/*
 * For C++ compilers, use extern "C"
2371
2372
2373
2374
2375
2376
2377












2378
2379
2380
2381
2382
2383
2384
			    Tcl_AppInitProc *appInitProc);
EXTERN const char *	Tcl_PkgInitStubsCheck(Tcl_Interp *interp,
			    const char *version, int exact);
#if defined(TCL_THREADS) && defined(USE_THREAD_ALLOC)
EXTERN void		Tcl_GetMemoryInfo(Tcl_DString *dsPtr);
#endif













/*
 *----------------------------------------------------------------------------
 * Include the public function declarations that are accessible via the stubs
 * table.
 */

#include "tclDecls.h"







>
>
>
>
>
>
>
>
>
>
>
>







2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
			    Tcl_AppInitProc *appInitProc);
EXTERN const char *	Tcl_PkgInitStubsCheck(Tcl_Interp *interp,
			    const char *version, int exact);
#if defined(TCL_THREADS) && defined(USE_THREAD_ALLOC)
EXTERN void		Tcl_GetMemoryInfo(Tcl_DString *dsPtr);
#endif

/*
 * Unfortunately, TCHAR is needed in tclPlatDecls.h for
 * win32, so if TCHAR is not defined yet do it here.
 * This way, we don't need to include <tchar.h> just
 * for one define.
 */
#if !defined(_TCHAR_DEFINED)
#   if defined(__WIN32__)
	typedef char TCHAR;
#	define _TCHAR_DEFINED
#   endif
#endif
/*
 *----------------------------------------------------------------------------
 * Include the public function declarations that are accessible via the stubs
 * table.
 */

#include "tclDecls.h"
Changes to generic/tclExecute.c.
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 * Copyright (c) 2005-2007 by Donal K. Fellows.
 * Copyright (c) 2007 Daniel A. Steffen <das@users.sourceforge.net>
 * Copyright (c) 2006-2008 by Joe Mistachkin.  All rights reserved.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclExecute.c,v 1.101.2.139 2010/03/26 14:21:07 dgp Exp $
 */

#include "tclInt.h"
#include "tclCompile.h"
#include "tommath.h"

#include <math.h>







|







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 * Copyright (c) 2005-2007 by Donal K. Fellows.
 * Copyright (c) 2007 Daniel A. Steffen <das@users.sourceforge.net>
 * Copyright (c) 2006-2008 by Joe Mistachkin.  All rights reserved.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclExecute.c,v 1.101.2.140 2010/04/19 15:58:52 dgp Exp $
 */

#include "tclInt.h"
#include "tclCompile.h"
#include "tommath.h"

#include <math.h>
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687











2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717



2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
	 * INVOCATION BLOCK
	 */

    {
	int objc, pcAdjustment;
	Tcl_Obj **objv;

	instEvalStk:
	case INST_EVAL_STK: {
	    /*
	     * Moved here to support transforming the eval of objects to a
	     * simple command invocation (for canonical lists) or a
	     * non-recursive TEBC call (compiled scripts).
	     */

	    ByteCode *newCodePtr;

	    objPtr = OBJ_AT_TOS;
	    cleanup = 1;
	    pcAdjustment = 1;

	    if (objPtr->typePtr == &tclListType) {	/* is a list... */
		List *listRepPtr = objPtr->internalRep.twoPtrValue.ptr1;
		Tcl_Obj *copyPtr;












		if (objPtr->bytes == NULL ||	/* ...without a string rep */
			listRepPtr->canonicalFlag) {/* ...or that is canonical
						     * */
		    if (Tcl_IsShared(objPtr)) {
			copyPtr = TclListObjCopy(interp, objPtr);
			Tcl_IncrRefCount(copyPtr);
			OBJ_AT_TOS = copyPtr;
			listRepPtr = copyPtr->internalRep.twoPtrValue.ptr1;
			Tcl_DecrRefCount(objPtr);
		    }
		    objc = listRepPtr->elemCount;
		    objv = &listRepPtr->elements;

		    /*
		     * Fix for [Bug 2102930]
		     */

		    iPtr->numLevels++;
		    Tcl_NRAddCallback(interp, NRCommand, NULL,NULL,NULL,NULL);
		    goto doInvocationFromEval;
		}
	    }

	    /*
	     * Run the bytecode in this same TEBC instance!
	     *
	     * TIP #280: The invoking context is left NULL for a dynamically
	     * constructed command. We cannot match its lines to the outer
	     * context.
	     */




	    DECACHE_STACK_INFO();
	    newCodePtr = TclCompileObj(interp, objPtr, NULL, 0);
	    bcFramePtr->data.tebc.pc = (char *) pc;
	    iPtr->cmdFramePtr = bcFramePtr;
	    pc++;
	    NR_DATA_BURY();
	    codePtr = newCodePtr;
	    goto nonRecursiveCallStart;
	}

    case INST_INVOKE_EXPANDED:
	{
	    CLANG_ASSERT(auxObjList);
	    objc = CURR_DEPTH
		    - (ptrdiff_t) auxObjList->internalRep.twoPtrValue.ptr1;
	    POP_TAUX_OBJ();
	}

	if (objc) {
	    pcAdjustment = 1;
	    goto doInvocation;
	}

	/*
	 * Nothing was expanded, return {}.







|
|
|
|
|
|
|

<
<
|
|
|

|
|
|

>
>
>
>
>
>
>
>
>
>
>
|
|
<
|
|
|
|
|
|
|
|
|

|
|
|

|
|
|
|
|

|
|
|
|
|
|
|
>
>
>












<
|
|
|
|
<
<







2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677


2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698

2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740

2741
2742
2743
2744


2745
2746
2747
2748
2749
2750
2751
	 * INVOCATION BLOCK
	 */

    {
	int objc, pcAdjustment;
	Tcl_Obj **objv;

    instEvalStk:
    case INST_EVAL_STK:
	/*
	 * Moved here to support transforming the eval of objects to a simple
	 * command invocation (for canonical lists) or a non-recursive TEBC
	 * call (compiled scripts).
	 */



	objPtr = OBJ_AT_TOS;
	cleanup = 1;
	pcAdjustment = 1;

	if (objPtr->typePtr == &tclListType) {
	    List *listRepPtr = objPtr->internalRep.twoPtrValue.ptr1;
	    Tcl_Obj *copyPtr;

	    /*
	     * Test if the list is "pure" or "canonical", since in that case
	     * we can know for sure that there are no syntactic nasties and
	     * treat the list's elements as literal words without need for
	     * further substitution. "Pure" lists are those that have no
	     * string representation at all; they're known OK because we know
	     * the algorithm for generating the string representation never
	     * produces hazards. "Canonical" lists are where we know that the
	     * string representation was produced from the internal
	     * representation of the list.
	     */

	    if (objPtr->bytes == NULL || listRepPtr->canonicalFlag) {

		if (Tcl_IsShared(objPtr)) {
		    copyPtr = TclListObjCopy(interp, objPtr);
		    Tcl_IncrRefCount(copyPtr);
		    OBJ_AT_TOS = copyPtr;
		    listRepPtr = copyPtr->internalRep.twoPtrValue.ptr1;
		    Tcl_DecrRefCount(objPtr);
		}
		objc = listRepPtr->elemCount;
		objv = &listRepPtr->elements;

		/*
		 * Fix for [Bug 2102930]
		 */

		iPtr->numLevels++;
		Tcl_NRAddCallback(interp, NRCommand, NULL,NULL,NULL,NULL);
		goto doInvocationFromEval;
	    }
	}

	/*
	 * Run the bytecode in this same TEBC instance!
	 *
	 * TIP #280: The invoking context is left NULL for a dynamically
	 * constructed command. We cannot match its lines to the outer
	 * context.
	 */

	{
	    ByteCode *newCodePtr;

	    DECACHE_STACK_INFO();
	    newCodePtr = TclCompileObj(interp, objPtr, NULL, 0);
	    bcFramePtr->data.tebc.pc = (char *) pc;
	    iPtr->cmdFramePtr = bcFramePtr;
	    pc++;
	    NR_DATA_BURY();
	    codePtr = newCodePtr;
	    goto nonRecursiveCallStart;
	}

    case INST_INVOKE_EXPANDED:

	CLANG_ASSERT(auxObjList);
	objc = CURR_DEPTH
		- (ptrdiff_t) auxObjList->internalRep.twoPtrValue.ptr1;
	POP_TAUX_OBJ();


	if (objc) {
	    pcAdjustment = 1;
	    goto doInvocation;
	}

	/*
	 * Nothing was expanded, return {}.
2804
2805
2806
2807
2808
2809
2810




2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843

2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925



2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979































2980
2981
2982
2983
2984
2985
2986

	TRESULT = TclNREvalObjv(interp, objc, objv,
		(*pc == INST_EVAL_STK) ? 0 : TCL_EVAL_NOERR, NULL);
	TRESULT = TclNRRunCallbacks(interp, TRESULT, BP->rootPtr, 1);
	CACHE_STACK_INFO();

	if (TOP_CB(interp) != BP->rootPtr) {




	    NRE_ASSERT(TRESULT == TCL_OK);
	    pc += pcAdjustment;

	nonRecursiveCallSetup:
	    {
		TEOV_callback *callbackPtr = TOP_CB(interp);
		int type = PTR2INT(callbackPtr->data[0]);
		ClientData param = callbackPtr->data[1];

		pcAdjustment = 0; /* silence warning */

		NRE_ASSERT(callbackPtr != BP->rootPtr);
		NRE_ASSERT(callbackPtr->procPtr == NRCallTEBC);

		TOP_CB(interp) = callbackPtr->nextPtr;
		TCLNR_FREE(interp, callbackPtr);

		NR_DATA_BURY();
		switch (type) {
		case TCL_NR_BC_TYPE:
		    if (param) {
			codePtr = param;
			goto nonRecursiveCallStart;
		    } else {
			OBP = BP;
			goto resumeCoroutine;
		    }
		    break;
		case TCL_NR_TAILCALL_TYPE:
		    /*
		     * A request to perform a tailcall: just drop this
		     * bytecode.
		     */

#ifdef TCL_COMPILE_DEBUG
		    if (traceInstructions) {
			fprintf(stdout, "   Tailcall request received\n");
		    }
#endif /* TCL_COMPILE_DEBUG */
		    iPtr->cmdFramePtr = bcFramePtr->nextPtr;
		    TclArgumentBCRelease((Tcl_Interp *) iPtr, bcFramePtr);

		    if (catchTop != initCatchTop) {
			TclClearTailcall(interp, param);
			iPtr->varFramePtr->tailcallPtr = NULL;
			TRESULT = TCL_ERROR;
			Tcl_SetResult(interp,
				"tailcall called from within a catch environment",
				TCL_STATIC);
			Tcl_SetErrorCode(interp, "TCL", "TAILCALL", "ILLEGAL",
				NULL);
			pc--;
			goto checkForCatch;
		    }
		    iPtr->varFramePtr->tailcallPtr = param;
		    TclSpliceTailcall(interp, param);
		    goto abnormalReturn;
		case TCL_NR_YIELD_TYPE: {	/* [yield] */
		    CoroutineData *corPtr = iPtr->execEnvPtr->corPtr;

		    if (!corPtr) {
			Tcl_SetResult(interp,
				"yield can only be called in a coroutine",
				TCL_STATIC);
			Tcl_SetErrorCode(interp, "TCL", "COROUTINE",
				"ILLEGAL_YIELD", NULL);
			TRESULT = TCL_ERROR;
			pc--;
			goto checkForCatch;
		    }

		    NRE_ASSERT(iPtr->execEnvPtr == corPtr->eePtr);
		    NRE_ASSERT(corPtr->stackLevel != NULL);
		    NRE_ASSERT(BP == corPtr->eePtr->bottomPtr);
		    if (corPtr->stackLevel != &TAUX) {
			Tcl_SetResult(interp, "cannot yield: C stack busy",
				TCL_STATIC);
			Tcl_SetErrorCode(interp, "TCL", "COROUTINE",
				"CANT_YIELD", NULL);
			TRESULT = TCL_ERROR;
			pc--;
			goto checkForCatch;
		    }

		    /*
		     * Mark suspended, save our state and return
		     */

		    corPtr->stackLevel = NULL;
		    iPtr->execEnvPtr = corPtr->callerEEPtr;
		    OBP = *corPtr->callerBPPtr;
		    goto returnToCaller;
		}
		default:
		    Tcl_Panic("TEBC: TRCB sent us a callback we cannot handle!");
		}
	    }
	}

	pc += pcAdjustment;

    nonRecursiveCallReturn:
	if (codePtr->flags & TCL_BYTECODE_RECOMPILE) {
	    iPtr->flags |= ERR_ALREADY_LOGGED;
	    codePtr->flags &= ~TCL_BYTECODE_RECOMPILE;
	}
	NRE_ASSERT(iPtr->cmdFramePtr == bcFramePtr);
	iPtr->cmdFramePtr = bcFramePtr->nextPtr;
	TclArgumentBCRelease((Tcl_Interp *) iPtr, bcFramePtr);

	/*
	 * If the CallFrame is marked as tailcalling, keep tailcalling
	 */

	if (iPtr->varFramePtr->tailcallPtr) {
	    if (catchTop != initCatchTop) {



		TclClearTailcall(interp, iPtr->varFramePtr->tailcallPtr);
		iPtr->varFramePtr->tailcallPtr = NULL;
		TRESULT = TCL_ERROR;
		Tcl_SetResult(interp,
			"tailcall called from within a catch environment",
			TCL_STATIC);
		Tcl_SetErrorCode(interp, "TCL", "TAILCALL", "ILLEGAL", NULL);
		pc--;
		goto checkForCatch;
	    }
	    goto abnormalReturn;
	}

	if (iPtr->execEnvPtr->rewind) {
	    TRESULT = TCL_ERROR;
	    goto abnormalReturn;
	}

	if (TRESULT == TCL_OK) {
#ifndef TCL_COMPILE_DEBUG
	    if (*pc == INST_POP) {
		NEXT_INST_V(1, cleanup, 0);
	    }
#endif
	    /*
	     * Push the call's object result and continue execution with the
	     * next instruction.
	     */

	    TRACE_WITH_OBJ(("%u => ... after \"%.20s\": TCL_OK, result=",
		    objc, cmdNameBuf), Tcl_GetObjResult(interp));

	    objResultPtr = Tcl_GetObjResult(interp);

	    /*
	     * Reset the interp's result to avoid possible duplications of
	     * large objects [Bug 781585]. We do not call Tcl_ResetResult to
	     * avoid any side effects caused by the resetting of errorInfo and
	     * errorCode [Bug 804681], which are not needed here. We chose
	     * instead to manipulate the interp's object result directly.
	     *
	     * Note that the result object is now in objResultPtr, it keeps
	     * the refCount it had in its role of iPtr->objResultPtr.
	     */

	    TclNewObj(objPtr);
	    Tcl_IncrRefCount(objPtr);
	    iPtr->objResultPtr = objPtr;
	    NEXT_INST_V(0, cleanup, -1);
	} else {
	    pc--;
	    goto processExceptionReturn;
	}
































#if TCL_SUPPORT_84_BYTECODE
    case INST_CALL_BUILTIN_FUNC1: {
	/*
	 * Call one of the built-in pre-8.5 Tcl math functions. This
	 * translates to INST_INVOKE_STK1 with the first argument of
	 * ::tcl::mathfunc::$objv[0]. We need to insert the named math
	 * function into the stack.







>
>
>
>




<
|
|
|

|

|
|

|
|

|
|
|
|
|
|
|
|
|
|
<
|
|
|
<
|
>

|
|
|

|
|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
|
|

|
|
|

|
|
|
|
|
|
|
<



















|
>
>
>
|
|
|
|
|
|
|
|
|
|
<
|
<





|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826

2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848

2849
2850
2851

2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914

2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947

2948

2949
2950
2951
2952
2953
2954































2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996

	TRESULT = TclNREvalObjv(interp, objc, objv,
		(*pc == INST_EVAL_STK) ? 0 : TCL_EVAL_NOERR, NULL);
	TRESULT = TclNRRunCallbacks(interp, TRESULT, BP->rootPtr, 1);
	CACHE_STACK_INFO();

	if (TOP_CB(interp) != BP->rootPtr) {
	    TEOV_callback *callbackPtr;
	    int type;
	    ClientData param;

	    NRE_ASSERT(TRESULT == TCL_OK);
	    pc += pcAdjustment;

	nonRecursiveCallSetup:

	    callbackPtr = TOP_CB(interp);
	    type = PTR2INT(callbackPtr->data[0]);
	    param = callbackPtr->data[1];

	    pcAdjustment = 0; /* silence warning */

	    NRE_ASSERT(callbackPtr != BP->rootPtr);
	    NRE_ASSERT(callbackPtr->procPtr == NRCallTEBC);

	    TOP_CB(interp) = callbackPtr->nextPtr;
	    TCLNR_FREE(interp, callbackPtr);

	    NR_DATA_BURY();
	    switch (type) {
	    case TCL_NR_BC_TYPE:
		if (param) {
		    codePtr = param;
		    goto nonRecursiveCallStart;
		} else {
		    OBP = BP;
		    goto resumeCoroutine;
		}

	    case TCL_NR_TAILCALL_TYPE:
		/*
		 * A request to perform a tailcall: just drop this bytecode.

		 */

#ifdef TCL_COMPILE_DEBUG
		if (traceInstructions) {
		    fprintf(stdout, "   Tailcall request received\n");
		}
#endif /* TCL_COMPILE_DEBUG */
		iPtr->cmdFramePtr = bcFramePtr->nextPtr;
		TclArgumentBCRelease((Tcl_Interp *) iPtr, bcFramePtr);

		if (catchTop != initCatchTop) {
		    TclClearTailcall(interp, param);
		    iPtr->varFramePtr->tailcallPtr = NULL;
		    TRESULT = TCL_ERROR;
		    Tcl_SetResult(interp,
			    "tailcall called from within a catch environment",
			    TCL_STATIC);
		    Tcl_SetErrorCode(interp, "TCL", "TAILCALL", "ILLEGAL",
			    NULL);
		    pc--;
		    goto checkForCatch;
		}
		iPtr->varFramePtr->tailcallPtr = param;
		TclSpliceTailcall(interp, param);
		goto abnormalReturn;
	    case TCL_NR_YIELD_TYPE: {		/* [yield] */
		CoroutineData *corPtr = iPtr->execEnvPtr->corPtr;

		if (!corPtr) {
		    Tcl_SetResult(interp,
			    "yield can only be called in a coroutine",
			    TCL_STATIC);
		    Tcl_SetErrorCode(interp, "TCL", "COROUTINE",
			    "ILLEGAL_YIELD", NULL);
		    TRESULT = TCL_ERROR;
		    pc--;
		    goto checkForCatch;
		}

		NRE_ASSERT(iPtr->execEnvPtr == corPtr->eePtr);
		NRE_ASSERT(corPtr->stackLevel != NULL);
		NRE_ASSERT(BP == corPtr->eePtr->bottomPtr);
		if (corPtr->stackLevel != &TAUX) {
		    Tcl_SetResult(interp, "cannot yield: C stack busy",
			    TCL_STATIC);
		    Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "CANT_YIELD",
			    NULL);
		    TRESULT = TCL_ERROR;
		    pc--;
		    goto checkForCatch;
		}

		/*
		 * Mark suspended, save our state and return
		 */

		corPtr->stackLevel = NULL;
		iPtr->execEnvPtr = corPtr->callerEEPtr;
		OBP = *corPtr->callerBPPtr;
		goto returnToCaller;
	    }
	    default:
		Tcl_Panic("TEBC: TRCB sent us a callback we cannot handle!");

	    }
	}

	pc += pcAdjustment;

    nonRecursiveCallReturn:
	if (codePtr->flags & TCL_BYTECODE_RECOMPILE) {
	    iPtr->flags |= ERR_ALREADY_LOGGED;
	    codePtr->flags &= ~TCL_BYTECODE_RECOMPILE;
	}
	NRE_ASSERT(iPtr->cmdFramePtr == bcFramePtr);
	iPtr->cmdFramePtr = bcFramePtr->nextPtr;
	TclArgumentBCRelease((Tcl_Interp *) iPtr, bcFramePtr);

	/*
	 * If the CallFrame is marked as tailcalling, keep tailcalling
	 */

	if (iPtr->varFramePtr->tailcallPtr) {
	    if (catchTop == initCatchTop) {
		goto abnormalReturn;
	    }

	    TclClearTailcall(interp, iPtr->varFramePtr->tailcallPtr);
	    iPtr->varFramePtr->tailcallPtr = NULL;
	    TRESULT = TCL_ERROR;
	    Tcl_SetResult(interp,
		    "tailcall called from within a catch environment",
		    TCL_STATIC);
	    Tcl_SetErrorCode(interp, "TCL", "TAILCALL", "ILLEGAL", NULL);
	    pc--;
	    goto checkForCatch;
	}



	if (iPtr->execEnvPtr->rewind) {
	    TRESULT = TCL_ERROR;
	    goto abnormalReturn;
	}

	if (TRESULT != TCL_OK) {































	    pc--;
	    goto processExceptionReturn;
	}

#ifndef TCL_COMPILE_DEBUG
	if (*pc == INST_POP) {
	    NEXT_INST_V(1, cleanup, 0);
	}
#endif
	/*
	 * Push the call's object result and continue execution with the next
	 * instruction.
	 */

	TRACE_WITH_OBJ(("%u => ... after \"%.20s\": TCL_OK, result=",
		objc, cmdNameBuf), Tcl_GetObjResult(interp));

	objResultPtr = Tcl_GetObjResult(interp);

	/*
	 * Reset the interp's result to avoid possible duplications of large
	 * objects [Bug 781585]. We do not call Tcl_ResetResult to avoid any
	 * side effects caused by the resetting of errorInfo and errorCode
	 * [Bug 804681], which are not needed here. We chose instead to
	 * manipulate the interp's object result directly.
	 *
	 * Note that the result object is now in objResultPtr, it keeps the
	 * refCount it had in its role of iPtr->objResultPtr.
	 */

	TclNewObj(objPtr);
	Tcl_IncrRefCount(objPtr);
	iPtr->objResultPtr = objPtr;
	NEXT_INST_V(0, cleanup, -1);

#if TCL_SUPPORT_84_BYTECODE
    case INST_CALL_BUILTIN_FUNC1: {
	/*
	 * Call one of the built-in pre-8.5 Tcl math functions. This
	 * translates to INST_INVOKE_STK1 with the first argument of
	 * ::tcl::mathfunc::$objv[0]. We need to insert the named math
	 * function into the stack.
Changes to generic/tclPlatDecls.h.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
45
46
47
48
49
/*
 * tclPlatDecls.h --
 *
 *	Declarations of platform specific Tcl APIs.
 *
 * Copyright (c) 1998-1999 by Scriptics Corporation.
 * All rights reserved.
 *
 * RCS: @(#) $Id: tclPlatDecls.h,v 1.19.2.13 2010/02/09 17:53:09 dgp Exp $
 */

#ifndef _TCLPLATDECLS
#define _TCLPLATDECLS

#undef TCL_STORAGE_CLASS
#ifdef BUILD_tcl
#   define TCL_STORAGE_CLASS DLLEXPORT
#else
#   ifdef USE_TCL_STUBS
#      define TCL_STORAGE_CLASS
#   else
#      define TCL_STORAGE_CLASS DLLIMPORT
#   endif
#endif

/*


 *  Pull in the typedef of TCHAR for windows.
 */
#if defined(__CYGWIN__)
    typedef char TCHAR;
#elif defined(__WIN32__) && !defined(_TCHAR_DEFINED)
#   include <tchar.h>
#   ifndef _TCHAR_DEFINED
	/* Borland seems to forget to set this. */
        typedef _TCHAR TCHAR;
#	define _TCHAR_DEFINED
#   endif
#   if defined(_MSC_VER) && defined(__STDC__)
	/* MSVC++ misses this. */
	typedef _TCHAR TCHAR;
#   endif
#endif

/* !BEGIN!: Do not edit below this line. */

/*
 * Exported function declarations:
 */









|

















>
>
|

<
<
<
<
<
<
<
<
<
<
<
<
<
<







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30














31
32
33
34
35
36
37
/*
 * tclPlatDecls.h --
 *
 *	Declarations of platform specific Tcl APIs.
 *
 * Copyright (c) 1998-1999 by Scriptics Corporation.
 * All rights reserved.
 *
 * RCS: @(#) $Id: tclPlatDecls.h,v 1.19.2.14 2010/04/19 15:58:52 dgp Exp $
 */

#ifndef _TCLPLATDECLS
#define _TCLPLATDECLS

#undef TCL_STORAGE_CLASS
#ifdef BUILD_tcl
#   define TCL_STORAGE_CLASS DLLEXPORT
#else
#   ifdef USE_TCL_STUBS
#      define TCL_STORAGE_CLASS
#   else
#      define TCL_STORAGE_CLASS DLLIMPORT
#   endif
#endif

/*
 * WARNING: This file is automatically generated by the tools/genStubs.tcl
 * script.  Any modifications to the function declarations below should be made
 * in the generic/tcl.decls script.
 */















/* !BEGIN!: Do not edit below this line. */

/*
 * Exported function declarations:
 */

Changes to library/platform/pkgIndex.tcl.
1
2
3
package ifneeded platform        1.0.5 [list source [file join $dir platform.tcl]]
package ifneeded platform::shell 1.1.4 [list source [file join $dir shell.tcl]]

|


1
2
3
package ifneeded platform        1.0.6 [list source [file join $dir platform.tcl]]
package ifneeded platform::shell 1.1.4 [list source [file join $dir shell.tcl]]

Changes to library/platform/platform.tcl.
171
172
173
174
175
176
177
178



179
180
181
182
183
184
185
	}
	linux {
	    # Look for the libc*.so and determine its version
	    # (libc5/6, libc6 further glibc 2.X)

	    set v unknown

	    if {[file exists /lib64] && [file isdirectory /lib64]} {



		set base /lib64
	    } else {
		set base /lib
	    }

	    set libclist [lsort [glob -nocomplain -directory $base libc*]]
	    if {[llength $libclist]} {







|
>
>
>







171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
	}
	linux {
	    # Look for the libc*.so and determine its version
	    # (libc5/6, libc6 further glibc 2.X)

	    set v unknown

	    if {[file exists /lib64] &&
		[file isdirectory /lib64] &&
		[llength [glob -nocomplain -directory /lib64 libc*]]
	    } {
		set base /lib64
	    } else {
		set base /lib
	    }

	    set libclist [lsort [glob -nocomplain -directory $base libc*]]
	    if {[llength $libclist]} {
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
		incr minor -1
		for {set j $minor} {$j >= 0} {incr j -1} {
		    lappend res linux-glibc${major}.${j}-${cpu}
		}
	    }
	}
	macosx*-*    {
	    # 10.5+
	    if {[regexp {macosx([^-]*)-(.*)} $id -> v cpu]} {
		if {$v ne ""} {
		    foreach {major minor} [split $v .] break

		    # Add 10.5 to 10.minor to patterns.
		    set res {}
		    for {set j $minor} {$j >= 5} {incr j -1} {







|







253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
		incr minor -1
		for {set j $minor} {$j >= 0} {incr j -1} {
		    lappend res linux-glibc${major}.${j}-${cpu}
		}
	    }
	}
	macosx*-*    {
	    # 10.5+ 
	    if {[regexp {macosx([^-]*)-(.*)} $id -> v cpu]} {
		if {$v ne ""} {
		    foreach {major minor} [split $v .] break

		    # Add 10.5 to 10.minor to patterns.
		    set res {}
		    for {set j $minor} {$j >= 5} {incr j -1} {
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
    return $res
}


# ### ### ### ######### ######### #########
## Ready

package provide platform 1.0.5

# ### ### ### ######### ######### #########
## Demo application

if {[info exists argv0] && ($argv0 eq [info script])} {
    puts ====================================
    parray tcl_platform







|







288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
    return $res
}


# ### ### ### ######### ######### #########
## Ready

package provide platform 1.0.6

# ### ### ### ######### ######### #########
## Demo application

if {[info exists argv0] && ($argv0 eq [info script])} {
    puts ====================================
    parray tcl_platform
Changes to unix/Makefile.in.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#
# This file is a Makefile for Tcl. If it has the name "Makefile.in" then it is
# a template for a Makefile; to generate the actual Makefile, run
# "./configure", which is a configuration script generated by the "autoconf"
# program (constructs like "@foo@" will get replaced in the actual Makefile.
#
# RCS: @(#) $Id: Makefile.in,v 1.127.2.92 2010/03/16 14:40:22 dgp Exp $

VERSION 		= @TCL_VERSION@
MAJOR_VERSION		= @TCL_MAJOR_VERSION@
MINOR_VERSION		= @TCL_MINOR_VERSION@
PATCH_LEVEL		= @TCL_PATCH_LEVEL@

#--------------------------------------------------------------------------






|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
#
# This file is a Makefile for Tcl. If it has the name "Makefile.in" then it is
# a template for a Makefile; to generate the actual Makefile, run
# "./configure", which is a configuration script generated by the "autoconf"
# program (constructs like "@foo@" will get replaced in the actual Makefile.
#
# RCS: @(#) $Id: Makefile.in,v 1.127.2.93 2010/04/19 15:58:52 dgp Exp $

VERSION 		= @TCL_VERSION@
MAJOR_VERSION		= @TCL_MAJOR_VERSION@
MINOR_VERSION		= @TCL_MINOR_VERSION@
PATCH_LEVEL		= @TCL_PATCH_LEVEL@

#--------------------------------------------------------------------------
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
	    $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/opt0.4; \
	    done;
	@echo "Installing package msgcat 1.4.3 as a Tcl Module";
	@$(INSTALL_DATA) $(TOP_DIR)/library/msgcat/msgcat.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.5/msgcat-1.4.3.tm;
	@echo "Installing package tcltest 2.3.2 as a Tcl Module";
	@$(INSTALL_DATA) $(TOP_DIR)/library/tcltest/tcltest.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.5/tcltest-2.3.2.tm;

	@echo "Installing package platform 1.0.5 as a Tcl Module";
	@$(INSTALL_DATA) $(TOP_DIR)/library/platform/platform.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/platform-1.0.5.tm;
	@echo "Installing package platform::shell 1.1.4 as a Tcl Module";
	@$(INSTALL_DATA) $(TOP_DIR)/library/platform/shell.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/platform/shell-1.1.4.tm;

	@echo "Installing library encoding directory";
	@for i in $(TOP_DIR)/library/encoding/*.enc ; do \
		$(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/encoding; \
	done;







|
|







852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
	    $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/opt0.4; \
	    done;
	@echo "Installing package msgcat 1.4.3 as a Tcl Module";
	@$(INSTALL_DATA) $(TOP_DIR)/library/msgcat/msgcat.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.5/msgcat-1.4.3.tm;
	@echo "Installing package tcltest 2.3.2 as a Tcl Module";
	@$(INSTALL_DATA) $(TOP_DIR)/library/tcltest/tcltest.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.5/tcltest-2.3.2.tm;

	@echo "Installing package platform 1.0.6 as a Tcl Module";
	@$(INSTALL_DATA) $(TOP_DIR)/library/platform/platform.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/platform-1.0.6.tm;
	@echo "Installing package platform::shell 1.1.4 as a Tcl Module";
	@$(INSTALL_DATA) $(TOP_DIR)/library/platform/shell.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/platform/shell-1.1.4.tm;

	@echo "Installing library encoding directory";
	@for i in $(TOP_DIR)/library/encoding/*.enc ; do \
		$(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/encoding; \
	done;
Changes to win/Makefile.in.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#
# This file is a Makefile for Tcl.  If it has the name "Makefile.in" then it
# is a template for a Makefile; to generate the actual Makefile, run
# "./configure", which is a configuration script generated by the "autoconf"
# program (constructs like "@foo@" will get replaced in the actual Makefile.
#
# RCS: @(#) $Id: Makefile.in,v 1.71.2.62 2010/04/02 23:48:14 dgp Exp $

VERSION = @TCL_VERSION@

#--------------------------------------------------------------------------
# Things you can change to personalize the Makefile for your own site (you can
# make these changes in either Makefile.in or Makefile, but changes to
# Makefile will get lost if you re-run the configuration script).






|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
#
# This file is a Makefile for Tcl.  If it has the name "Makefile.in" then it
# is a template for a Makefile; to generate the actual Makefile, run
# "./configure", which is a configuration script generated by the "autoconf"
# program (constructs like "@foo@" will get replaced in the actual Makefile.
#
# RCS: @(#) $Id: Makefile.in,v 1.71.2.63 2010/04/19 15:58:52 dgp Exp $

VERSION = @TCL_VERSION@

#--------------------------------------------------------------------------
# Things you can change to personalize the Makefile for your own site (you can
# make these changes in either Makefile.in or Makefile, but changes to
# Makefile will get lost if you re-run the configuration script).
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
	    do \
	    $(COPY) "$$j" "$(SCRIPT_INSTALL_DIR)/opt0.4"; \
	    done;
	@echo "Installing package msgcat 1.4.3 as a Tcl Module";
	@$(COPY) $(ROOT_DIR)/library/msgcat/msgcat.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/msgcat-1.4.3.tm;
	@echo "Installing package tcltest 2.3.2 as a Tcl Module";
	@$(COPY) $(ROOT_DIR)/library/tcltest/tcltest.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/tcltest-2.3.2.tm;
	@echo "Installing package platform 1.0.5 as a Tcl Module";
	@$(COPY) $(ROOT_DIR)/library/platform/platform.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.4/platform-1.0.5.tm;
	@echo "Installing package platform::shell 1.1.4 as a Tcl Module";
	@$(COPY) $(ROOT_DIR)/library/platform/shell.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.4/platform/shell-1.1.4.tm;
	@echo "Installing encodings";
	@for i in $(ROOT_DIR)/library/encoding/*.enc ; do \
		$(COPY) "$$i" "$(SCRIPT_INSTALL_DIR)/encoding"; \
	done;








|
|







674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
	    do \
	    $(COPY) "$$j" "$(SCRIPT_INSTALL_DIR)/opt0.4"; \
	    done;
	@echo "Installing package msgcat 1.4.3 as a Tcl Module";
	@$(COPY) $(ROOT_DIR)/library/msgcat/msgcat.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/msgcat-1.4.3.tm;
	@echo "Installing package tcltest 2.3.2 as a Tcl Module";
	@$(COPY) $(ROOT_DIR)/library/tcltest/tcltest.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/tcltest-2.3.2.tm;
	@echo "Installing package platform 1.0.6 as a Tcl Module";
	@$(COPY) $(ROOT_DIR)/library/platform/platform.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.4/platform-1.0.6.tm;
	@echo "Installing package platform::shell 1.1.4 as a Tcl Module";
	@$(COPY) $(ROOT_DIR)/library/platform/shell.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.4/platform/shell-1.1.4.tm;
	@echo "Installing encodings";
	@for i in $(ROOT_DIR)/library/encoding/*.enc ; do \
		$(COPY) "$$i" "$(SCRIPT_INSTALL_DIR)/encoding"; \
	done;

Changes to win/tclWinFile.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
 * tclWinFile.c --
 *
 *	This file contains temporary wrappers around UNIX file handling
 *	functions. These wrappers map the UNIX functions to Win32 HANDLE-style
 *	files, which can be manipulated through the Win32 console redirection
 *	interfaces.
 *
 * Copyright (c) 1995-1998 Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclWinFile.c,v 1.50.2.34 2010/03/08 14:34:04 dgp Exp $
 */

/* #define _WIN32_WINNT	0x0500 */

#include "tclWinInt.h"
#include "tclFileSystem.h"
#include <winioctl.h>













|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
 * tclWinFile.c --
 *
 *	This file contains temporary wrappers around UNIX file handling
 *	functions. These wrappers map the UNIX functions to Win32 HANDLE-style
 *	files, which can be manipulated through the Win32 console redirection
 *	interfaces.
 *
 * Copyright (c) 1995-1998 Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclWinFile.c,v 1.50.2.35 2010/04/19 15:58:52 dgp Exp $
 */

/* #define _WIN32_WINNT	0x0500 */

#include "tclWinInt.h"
#include "tclFileSystem.h"
#include <winioctl.h>
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
	    return 0;
	}

	/*
	 * Use wide-char case-insensitive comparison
	 */

	if ((wcscasecmp(path+len-3, L"exe") == 0)
		|| (wcscasecmp(path+len-3, L"com") == 0)
		|| (wcscasecmp(path+len-3, L"bat") == 0)) {
	    return 1;
	}
    } else {
	const char *p;

	/*
	 * We are only looking for pure ascii.







|
|
|







1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
	    return 0;
	}

	/*
	 * Use wide-char case-insensitive comparison
	 */

	if ((_wcsicmp(path+len-3, L"exe") == 0)
		|| (_wcsicmp(path+len-3, L"com") == 0)
		|| (_wcsicmp(path+len-3, L"bat") == 0)) {
	    return 1;
	}
    } else {
	const char *p;

	/*
	 * We are only looking for pure ascii.
Changes to win/tclWinLoad.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 * tclWinLoad.c --
 *
 *	This function provides a version of the TclLoadFile that works with
 *	the Windows "LoadLibrary" and "GetProcAddress" API for dynamic
 *	loading.
 *
 * Copyright (c) 1995-1997 Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclWinLoad.c,v 1.15.4.9 2010/04/02 23:48:14 dgp Exp $
 */

#include "tclWinInt.h"

/*
 * Mutex protecting static data in this file;
 */












|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 * tclWinLoad.c --
 *
 *	This function provides a version of the TclLoadFile that works with
 *	the Windows "LoadLibrary" and "GetProcAddress" API for dynamic
 *	loading.
 *
 * Copyright (c) 1995-1997 Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclWinLoad.c,v 1.15.4.10 2010/04/19 15:58:52 dgp Exp $
 */

#include "tclWinInt.h"

/*
 * Mutex protecting static data in this file;
 */
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
     * succeeds)
     */

    nameLen = 0;
    if (dllDirectoryName == NULL) {
	Tcl_MutexLock(&loadMutex);
	if (dllDirectoryName == NULL) {
	    if ((nameLen = GetTempPathW(MAX_PATH, name)) >= 0) {
		if (nameLen >= MAX_PATH-12) {
		    Tcl_SetErrno(ENAMETOOLONG);
		    nameLen = 0;
		} else {
		    wcscpy(name+nameLen, L"TCLXXXXXXXX");
		    nameLen += 11;
		}
	    }
	    status = 1;
	    if (nameLen != 0) {
		DWORD id;
		int i = 0;
		id = GetCurrentProcessId();
		for (;;) {







|
|
|
|
|
|
|
<







301
302
303
304
305
306
307
308
309
310
311
312
313
314

315
316
317
318
319
320
321
     * succeeds)
     */

    nameLen = 0;
    if (dllDirectoryName == NULL) {
	Tcl_MutexLock(&loadMutex);
	if (dllDirectoryName == NULL) {
	    nameLen = GetTempPathW(MAX_PATH, name);
	    if (nameLen >= MAX_PATH-12) {
		Tcl_SetErrno(ENAMETOOLONG);
		nameLen = 0;
	    } else {
		wcscpy(name+nameLen, L"TCLXXXXXXXX");
		nameLen += 11;

	    }
	    status = 1;
	    if (nameLen != 0) {
		DWORD id;
		int i = 0;
		id = GetCurrentProcessId();
		for (;;) {
Changes to win/tclWinPort.h.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 * tclWinPort.h --
 *
 *	This header file handles porting issues that occur because of
 *	differences between Windows and Unix. It should be the only
 *	file that contains #ifdefs to handle different flavors of OS.
 *
 * Copyright (c) 1994-1997 Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclWinPort.h,v 1.36.4.15 2010/01/22 13:11:40 dgp Exp $
 */

#ifndef _TCLWINPORT
#define _TCLWINPORT

#define WIN32_LEAN_AND_MEAN
#include <windows.h>












|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 * tclWinPort.h --
 *
 *	This header file handles porting issues that occur because of
 *	differences between Windows and Unix. It should be the only
 *	file that contains #ifdefs to handle different flavors of OS.
 *
 * Copyright (c) 1994-1997 Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclWinPort.h,v 1.36.4.16 2010/04/19 15:58:52 dgp Exp $
 */

#ifndef _TCLWINPORT
#define _TCLWINPORT

#define WIN32_LEAN_AND_MEAN
#include <windows.h>
31
32
33
34
35
36
37












38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65

66



67
68




69
70
71
72
73
74
75
#   define UNICODE
#   define __TCHAR_DEFINED
    typedef float *_TCHAR;
#   define _TCHAR_DEFINED
    typedef float *TCHAR;
#endif /* CHECK_UNICODE_CALLS */













/*
 *---------------------------------------------------------------------------
 * The following sets of #includes and #ifdefs are required to get Tcl to
 * compile under the windows compilers.
 *---------------------------------------------------------------------------
 */

#ifdef __CYGWIN__
#   include <unistd.h>
#   include <wchar.h>
#else
#   include <io.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
#include <float.h>
#include <malloc.h>
#include <process.h>
#include <signal.h>
#include <string.h>

/*
 * These string functions are not defined with the same names on Windows.
 */

#ifndef __CYGWIN__

#define wcscasecmp _wcsicmp



#define strcasecmp stricmp
#define strncasecmp strnicmp




#endif

/*
 * Need to block out these includes for building extensions with MetroWerks
 * compiler for Win32.
 */








>
>
>
>
>
>
>
>
>
>
>
>







<
<
|
<
|
<
|
|








<
<
<
<
|
>
|
>
>
>
|
|
>
>
>
>







31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56


57

58

59
60
61
62
63
64
65
66
67
68




69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#   define UNICODE
#   define __TCHAR_DEFINED
    typedef float *_TCHAR;
#   define _TCHAR_DEFINED
    typedef float *TCHAR;
#endif /* CHECK_UNICODE_CALLS */

/*
 *  Pull in the typedef of TCHAR for windows.
 */
#if !defined(_TCHAR_DEFINED)
#   include <tchar.h>
#   ifndef _TCHAR_DEFINED
	/* Borland seems to forget to set this. */
	typedef _TCHAR TCHAR;
#	define _TCHAR_DEFINED
#   endif
#endif

/*
 *---------------------------------------------------------------------------
 * The following sets of #includes and #ifdefs are required to get Tcl to
 * compile under the windows compilers.
 *---------------------------------------------------------------------------
 */



#include <wchar.h>

#include <io.h>

#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
#include <float.h>
#include <malloc.h>
#include <process.h>
#include <signal.h>
#include <string.h>





#ifdef __CYGWIN__
#   include <unistd.h>
#   ifndef _wcsicmp
#	define _wcsicmp wcscasecmp
#   endif
#else
#   ifndef strncasecmp
#	define strncasecmp strnicmp
#   endif
#   ifndef strcasecmp
#	define strcasecmp stricmp
#   endif
#endif

/*
 * Need to block out these includes for building extensions with MetroWerks
 * compiler for Win32.
 */

301
302
303
304
305
306
307
308
309
310
311
312
313
314
315

/*
 * Define macros to query file type bits, if they're not already
 * defined.
 */

#ifndef S_IFLNK
#define S_IFLNK        0120000  /* Symbolic Link */
#endif

#ifndef S_ISREG
#   ifdef S_IFREG
#       define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
#   else
#       define S_ISREG(m) 0







|







313
314
315
316
317
318
319
320
321
322
323
324
325
326
327

/*
 * Define macros to query file type bits, if they're not already
 * defined.
 */

#ifndef S_IFLNK
#   define S_IFLNK        0120000  /* Symbolic Link */
#endif

#ifndef S_ISREG
#   ifdef S_IFREG
#       define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
#   else
#       define S_ISREG(m) 0
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413


/*
 * Define MAXPATHLEN in terms of MAXPATH if available
 */

#ifndef MAXPATH
#define MAXPATH MAX_PATH
#endif /* MAXPATH */

#ifndef MAXPATHLEN
#define MAXPATHLEN MAXPATH
#endif /* MAXPATHLEN */

/*
 * Define pid_t and uid_t if they're not already defined.
 */

#if ! TCL_PID_T
#   define pid_t int
#endif /* !TCL_PID_T */
#if ! TCL_UID_T
#   define uid_t int
#endif /* !TCL_UID_T */

/*
 * Visual C++ has some odd names for common functions, so we need to
 * define a few macros to handle them.  Also, it defines EDEADLOCK and
 * EDEADLK as the same value, which confuses Tcl_ErrnoId().
 */

#if defined(_MSC_VER) || defined(__MINGW32__)
#    define environ _environ
#    define hypot _hypot
#    define exception _exception
#    undef EDEADLOCK
#    if defined(__MINGW32__) && !defined(__MSVCRT__)
#	define timezone _timezone
#    endif
#endif /* _MSC_VER || __MINGW32__ */

/*
 * Borland's timezone and environ functions.
 */

#ifdef  __BORLANDC__
#   define timezone _timezone
#   define environ  _environ
#endif /* __BORLANDC__ */

#ifdef __CYGWIN__
/* On Cygwin, the environment is imported from the Cygwin DLL. */
#    define putenv TclCygwinPutenv
#    define timezone _timezone
#endif /* __CYGWIN__ */


#ifdef __WATCOMC__
    /*
     * OpenWatcom uses a wine derived winsock2.h that is missing the
     * LPFN_* typedefs.







|



|




















|
|
|
|
|

|













|
|







365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425


/*
 * Define MAXPATHLEN in terms of MAXPATH if available
 */

#ifndef MAXPATH
#   define MAXPATH MAX_PATH
#endif /* MAXPATH */

#ifndef MAXPATHLEN
#   define MAXPATHLEN MAXPATH
#endif /* MAXPATHLEN */

/*
 * Define pid_t and uid_t if they're not already defined.
 */

#if ! TCL_PID_T
#   define pid_t int
#endif /* !TCL_PID_T */
#if ! TCL_UID_T
#   define uid_t int
#endif /* !TCL_UID_T */

/*
 * Visual C++ has some odd names for common functions, so we need to
 * define a few macros to handle them.  Also, it defines EDEADLOCK and
 * EDEADLK as the same value, which confuses Tcl_ErrnoId().
 */

#if defined(_MSC_VER) || defined(__MINGW32__)
#   define environ _environ
#   define hypot _hypot
#   define exception _exception
#   undef EDEADLOCK
#   if defined(__MINGW32__) && !defined(__MSVCRT__)
#	define timezone _timezone
#   endif
#endif /* _MSC_VER || __MINGW32__ */

/*
 * Borland's timezone and environ functions.
 */

#ifdef  __BORLANDC__
#   define timezone _timezone
#   define environ  _environ
#endif /* __BORLANDC__ */

#ifdef __CYGWIN__
/* On Cygwin, the environment is imported from the Cygwin DLL. */
#   define putenv TclCygwinPutenv
#   define timezone _timezone
#endif /* __CYGWIN__ */


#ifdef __WATCOMC__
    /*
     * OpenWatcom uses a wine derived winsock2.h that is missing the
     * LPFN_* typedefs.