summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-10-14 08:11:59 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-10-14 08:11:59 (GMT)
commitd02f468b979104d4c98a39347be7960486530e1c (patch)
tree13e0e9fb6680f2a21906d0db604753cf2526a42f
parent2dc26cc732ba64065c0bf64d8c63a2c82c539999 (diff)
downloadtcl-d02f468b979104d4c98a39347be7960486530e1c.zip
tcl-d02f468b979104d4c98a39347be7960486530e1c.tar.gz
tcl-d02f468b979104d4c98a39347be7960486530e1c.tar.bz2
Fix comment in tclOO.decls: tclOOStubLib.c is not generated by "make genstubs".
In pkgooa.c, check whether the internal TclOO stub table is initialized correctly as well, some internal simplifications and improved comments.
-rw-r--r--generic/tclOO.decls3
-rw-r--r--unix/dltest/pkgooa.c48
2 files changed, 17 insertions, 34 deletions
diff --git a/generic/tclOO.decls b/generic/tclOO.decls
index 4f1987c..5d6f2c2 100644
--- a/generic/tclOO.decls
+++ b/generic/tclOO.decls
@@ -3,8 +3,7 @@
# This file contains the declarations for all supported public functions
# that are exported by the TclOO package that is embedded within the Tcl
# library via the stubs table. This file is used to generate the
-# tclOODecls.h, tclOOIntDecls.h, tclOOStubInit.c, and tclOOStubLib.c
-# files.
+# tclOODecls.h, tclOOIntDecls.h and tclOOStubInit.c files.
#
# Copyright (c) 2008-2013 by Donal K. Fellows.
#
diff --git a/unix/dltest/pkgooa.c b/unix/dltest/pkgooa.c
index c0c1605..7b14ca0 100644
--- a/unix/dltest/pkgooa.c
+++ b/unix/dltest/pkgooa.c
@@ -11,24 +11,8 @@
*/
#undef STATIC_BUILD
-#include "tclOO.h"
+#include "tclOOInt.h"
#include <string.h>
-
-/*
- * TCL_STORAGE_CLASS is set unconditionally to DLLEXPORT because the
- * Pkgooa_Init declaration is in the source file itself, which is only
- * accessed when we are building a library.
- */
-#undef TCL_STORAGE_CLASS
-#define TCL_STORAGE_CLASS DLLEXPORT
-
-/*
- * Prototypes for procedures defined later in this file:
- */
-
-static int Pkgooa_StubsOKObjCmd(ClientData clientData,
- Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
-
/*
*----------------------------------------------------------------------
@@ -80,26 +64,22 @@ Pkgooa_StubsOKObjCmd(
*----------------------------------------------------------------------
*/
-static Tcl_Object copyObjectInstance(Tcl_Interp *interp,
- Tcl_Object source, const char *name, const char *nameSpace)
-{
- Tcl_Object result;
- result = Tcl_CopyObjectInstance(interp, source, name, nameSpace);
- if (result == NULL) {
- Tcl_AppendResult(interp, "ERROR: copy failed.");
- }
- return result;
-}
-
static TclOOStubs stubsCopy = {
TCL_STUB_MAGIC,
NULL,
- copyObjectInstance
- /* more entries here, but those are not
- * needed for this test-case. */
+ /* It doesn't really matter what implementation of
+ * Tcl_CopyObjectInstance is put in the "pseudo"
+ * stub table, since the test-case never actually
+ * calls this function. All that matters is that it's
+ * a function with a different memory address than
+ * the real Tcl_CopyObjectInstance function in Tcl. */
+ (Tcl_Object (*) (Tcl_Interp *, Tcl_Object, const char *,
+ const char *t)) Pkgooa_StubsOKObjCmd
+ /* More entries could be here, but those are not used
+ * for this test-case. So, being NULL is OK. */
};
-EXTERN int
+extern DLLEXPORT int
Pkgooa_Init(
Tcl_Interp *interp) /* Interpreter in which the package is to be
* made available. */
@@ -129,6 +109,10 @@ Pkgooa_Init(
Tcl_AppendResult(interp, "TclOO stubs are not inialized");
return TCL_ERROR;
}
+ if (tclOOIntStubsPtr == NULL) {
+ Tcl_AppendResult(interp, "TclOO internal stubs are not inialized");
+ return TCL_ERROR;
+ }
/* Test case for Bug [f51efe99a7].
*