Tcl Source Code

Check-in [87689a5b66]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Sep 9.

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

Overview
Comment:Fix for [39fed4dae5].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | pyk-bug-39fed4dae5
Files: files | file ages | folders
SHA3-256:87689a5b66bc2669c5b4bdd2b4cd9b0fbdfc8772b7215a9f8a9eefba18737195
User & Date: pooryorick 2019-03-06 15:36:30
References
2019-03-06
15:49 Ticket [39fed4dae5] Tcl_PkgRequireEx, Tcl_InitStubs broken in 8.6.9 status still Open with 3 other changes artifact: 73c6acd673 user: pooryorick
Context
2019-03-07
09:43
Better fix, not hackish any-more, but retaining the original idea check-in: 0a4f70654f user: jan.nijtmans tags: jn-bug-39fed4dae5
2019-03-06
15:36
Fix for [39fed4dae5]. Closed-Leaf check-in: 87689a5b66 user: pooryorick tags: pyk-bug-39fed4dae5
06:26
V1.3. PLATFORM_IDENTIFY, MULTIPLATFORM_INSTALL macro, optionally copy PDBs.

The PLATFORM_IDENTIFY m... check-in: 200622a9d4 user: apnadkarni tags: core-8-6-branch

Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclPkg.c.

314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
...
453
454
455
456
457
458
459

460
461
462
463
464
465
466
...
491
492
493
494
495
496
497

498


499
500
501
502
503
504
505

    /*
     * Translate between old and new API, and defer to the new function.
     */

    if (version == NULL) {
	if (Tcl_PkgRequireProc(interp, name, 0, NULL, clientDataPtr) == TCL_OK) {
	    result = Tcl_GetStringResult(interp);
	    Tcl_ResetResult(interp);
	}
    } else {
	if (exact && TCL_OK
		!= CheckVersionAndConvert(interp, version, NULL, NULL)) {
	    return NULL;
	}
	ov = Tcl_NewStringObj(version, -1);
	if (exact) {
	    Tcl_AppendStringsToObj(ov, "-", version, NULL);
	}
	Tcl_IncrRefCount(ov);
	if (Tcl_PkgRequireProc(interp, name, 1, &ov, clientDataPtr) == TCL_OK) {
	    result = Tcl_GetStringResult(interp);
	    Tcl_ResetResult(interp);
	}
	TclDecrRefCount(ov);
    }
    return result;
}

................................................................................
    return TCL_OK;
}

static int
PkgRequireCoreFinal(ClientData data[], Tcl_Interp *interp, int result) {
    Require *reqPtr = data[0];
    int reqc = PTR2INT(data[1]), satisfies;

    Tcl_Obj **const reqv = data[2];
    char *pkgVersionI;
    void *clientDataPtr = reqPtr->clientDataPtr;
    const char *name = reqPtr->name /* Name of desired package. */;
    if (reqPtr->pkgPtr->version == NULL) {
	Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		"can't find package %s", name));
................................................................................
    }

    if (clientDataPtr) {
	const void **ptr = (const void **) clientDataPtr;

	*ptr = reqPtr->pkgPtr->clientData;
    }

    Tcl_SetObjResult(interp, Tcl_NewStringObj(reqPtr->pkgPtr->version, -1));


    return TCL_OK;
}

static int
PkgRequireCoreCleanup(ClientData data[], Tcl_Interp *interp, int result) {
    ckfree(data[0]);
    return result;







|













|







 







>







 







>
|
>
>







314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
...
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
...
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509

    /*
     * Translate between old and new API, and defer to the new function.
     */

    if (version == NULL) {
	if (Tcl_PkgRequireProc(interp, name, 0, NULL, clientDataPtr) == TCL_OK) {
	    result = Tcl_GetObjResult(interp)->internalRep.twoPtrValue.ptr1;
	    Tcl_ResetResult(interp);
	}
    } else {
	if (exact && TCL_OK
		!= CheckVersionAndConvert(interp, version, NULL, NULL)) {
	    return NULL;
	}
	ov = Tcl_NewStringObj(version, -1);
	if (exact) {
	    Tcl_AppendStringsToObj(ov, "-", version, NULL);
	}
	Tcl_IncrRefCount(ov);
	if (Tcl_PkgRequireProc(interp, name, 1, &ov, clientDataPtr) == TCL_OK) {
	    result = Tcl_GetObjResult(interp)->internalRep.twoPtrValue.ptr1;
	    Tcl_ResetResult(interp);
	}
	TclDecrRefCount(ov);
    }
    return result;
}

................................................................................
    return TCL_OK;
}

static int
PkgRequireCoreFinal(ClientData data[], Tcl_Interp *interp, int result) {
    Require *reqPtr = data[0];
    int reqc = PTR2INT(data[1]), satisfies;
    Tcl_Obj *res;
    Tcl_Obj **const reqv = data[2];
    char *pkgVersionI;
    void *clientDataPtr = reqPtr->clientDataPtr;
    const char *name = reqPtr->name /* Name of desired package. */;
    if (reqPtr->pkgPtr->version == NULL) {
	Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		"can't find package %s", name));
................................................................................
    }

    if (clientDataPtr) {
	const void **ptr = (const void **) clientDataPtr;

	*ptr = reqPtr->pkgPtr->clientData;
    }

    res = Tcl_NewStringObj(reqPtr->pkgPtr->version ,-1);
    res->internalRep.twoPtrValue.ptr1 = reqPtr->pkgPtr->version;
    Tcl_SetObjResult(interp, res);
    return TCL_OK;
}

static int
PkgRequireCoreCleanup(ClientData data[], Tcl_Interp *interp, int result) {
    ckfree(data[0]);
    return result;