Attachment "tclOOhooks.diff" to
ticket [1980953fff]
added by
das
2008-06-01 07:55:21.
Index: generic/tclOO.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclOO.c,v
retrieving revision 1.6
diff -u -p -r1.6 tclOO.c
--- generic/tclOO.c 31 May 2008 23:35:27 -0000 1.6
+++ generic/tclOO.c 1 Jun 2008 00:52:26 -0000
@@ -118,7 +118,7 @@ static char initScript[] =
/* "tcl_findLibrary tcloo $oo::version $oo::version" */
/* " tcloo.tcl OO_LIBRARY oo::library;"; */
-MODULE_SCOPE const struct TclOOStubAPI * const tclOOStubAPIPtr;
+MODULE_SCOPE const TclOOStubs * const tclOOConstStubPtr;
/*
* Convenience macro for getting the foundation from an interpreter.
@@ -164,7 +164,7 @@ TclOOInit(
}
return Tcl_PkgProvideEx(interp, "TclOO", TCLOO_VERSION,
- (ClientData) tclOOStubAPIPtr);
+ (ClientData) tclOOConstStubPtr);
}
/*
Index: generic/tclOOIntDecls.h
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclOOIntDecls.h,v
retrieving revision 1.3
diff -u -p -r1.3 tclOOIntDecls.h
--- generic/tclOOIntDecls.h 1 Jun 2008 00:33:05 -0000 1.3
+++ generic/tclOOIntDecls.h 1 Jun 2008 00:52:26 -0000
@@ -237,8 +237,3 @@ extern CONST TclOOIntStubs *tclOOIntStub
#endif /* defined(USE_TCLOO_STUBS) && !defined(USE_TCLOO_STUB_PROCS) */
/* !END!: Do not edit above this line. */
-
-struct TclOOStubAPI {
- CONST TclOOStubs *stubsPtr;
- CONST TclOOIntStubs *intStubsPtr;
-};
Index: generic/tclOOStubInit.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclOOStubInit.c,v
retrieving revision 1.3
diff -u -p -r1.3 tclOOStubInit.c
--- generic/tclOOStubInit.c 1 Jun 2008 00:33:05 -0000 1.3
+++ generic/tclOOStubInit.c 1 Jun 2008 00:52:26 -0000
@@ -73,11 +73,6 @@ static const TclOOStubs tclOOStubs = {
/* !END!: Do not edit above this line. */
-static const struct TclOOStubAPI tclOOStubAPI = {
- &tclOOStubs,
- &tclOOIntStubs
-};
-
-MODULE_SCOPE const struct TclOOStubAPI * const tclOOStubAPIPtr;
-const struct TclOOStubAPI * const tclOOStubAPIPtr = &tclOOStubAPI;
+MODULE_SCOPE const TclOOStubs * const tclOOConstStubPtr;
+const TclOOStubs * const tclOOConstStubPtr = &tclOOStubs;
Index: generic/tclOOStubLib.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclOOStubLib.c,v
retrieving revision 1.3
diff -u -p -r1.3 tclOOStubLib.c
--- generic/tclOOStubLib.c 1 Jun 2008 00:33:05 -0000 1.3
+++ generic/tclOOStubLib.c 1 Jun 2008 00:52:26 -0000
@@ -53,16 +53,16 @@ TclOOInitializeStubs(
ClientData clientData = NULL;
const char *actualVersion =
Tcl_PkgRequireEx(interp, packageName,version, exact, &clientData);
- struct TclOOStubAPI *stubsAPIPtr = clientData;
- if (stubsAPIPtr == NULL) {
+ if (clientData == NULL) {
Tcl_ResetResult(interp);
Tcl_AppendResult(interp, "Error loading ", packageName, " package; ",
"package not present or incomplete", NULL);
return NULL;
} else {
- const TclOOStubs * const stubsPtr = stubsAPIPtr->stubsPtr;
- const TclOOIntStubs * const intStubsPtr = stubsAPIPtr->intStubsPtr;
+ const TclOOStubs * const stubsPtr = clientData;
+ const TclOOIntStubs * const intStubsPtr = stubsPtr->hooks ?
+ stubsPtr->hooks->tclOOIntStubs : NULL;
if (!actualVersion) {
return NULL;