Tcl Source Code

Artifact [bea396a26e]
Login

Artifact bea396a26e08af381f148f64c0e730911cdeb3cc:

Attachment "tcl-stublib.patch" to ticket [1091431fff] added by jenglish 2005-11-21 01:37:40.
Date: Sun Nov 20 10:30:26 -0800 2005
Files: generic/tclStubLib.c
Bugid: 1091431

--- generic/tclStubLib.c.stublib.old	2005-11-20 09:56:14.000000000 -0800
+++ generic/tclStubLib.c	2005-11-20 10:27:54.083483534 -0800
@@ -32,16 +32,11 @@
  * functions should be built as non-exported symbols.
  */
 
-#undef TCL_STORAGE_CLASS
-#define TCL_STORAGE_CLASS DLLEXPORT
-
 TclStubs *tclStubsPtr = NULL;
 TclPlatStubs *tclPlatStubsPtr = NULL;
 TclIntStubs *tclIntStubsPtr = NULL;
 TclIntPlatStubs *tclIntPlatStubsPtr = NULL;
 
-static TclStubs *	HasStubSupport(Tcl_Interp *interp);
-
 static TclStubs *
 HasStubSupport(
     Tcl_Interp *interp)
@@ -87,8 +82,7 @@
     int exact)
 {
     CONST char *actualVersion = NULL;
-    TclStubs *tmp;
-    TclStubs **tmpp;
+    ClientData pkgData = NULL;
 
     /*
      * We can't optimize this check by caching tclStubsPtr because that
@@ -101,17 +95,11 @@
 	return NULL;
     }
 
-    /*
-     * This is needed to satisfy GCC 3.3's strict aliasing rules.
-     */
-
-    tmpp = &tmp;
-    actualVersion = Tcl_PkgRequireEx(interp, "Tcl", version, exact,
-	    (ClientData *) tmpp);
+    actualVersion = Tcl_PkgRequireEx(interp, "Tcl", version, exact, &pkgData);
     if (actualVersion == NULL) {
-	tclStubsPtr = NULL;
 	return NULL;
     }
+    tclStubsPtr = (TclStubs*)pkgData;
 
     if (tclStubsPtr->hooks) {
 	tclPlatStubsPtr = tclStubsPtr->hooks->tclPlatStubs;