summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-11-19 21:57:09 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-11-19 21:57:09 (GMT)
commitb8bb091e43904fa2897b72f1853d1d9f298d26ac (patch)
tree2e1c470dd2a4ee3ac2773f9bd6ee3feb8668be63
parent9c8731a3a9259e66d93d399531844eebc954544e (diff)
parent7f4b300e2a1f846f1aff77518a22caf720b83725 (diff)
downloadtcl-tcl_nosize.zip
tcl-tcl_nosize.tar.gz
tcl-tcl_nosize.tar.bz2
(Bad idea)tcl_nosize
-rw-r--r--generic/tcl.h6
-rwxr-xr-xgeneric/tclStrToD.c2
-rw-r--r--generic/tclStubLib.c3
-rw-r--r--generic/tclStubLibCompat.c57
-rw-r--r--unix/Makefile.in10
-rw-r--r--win/Makefile.in4
-rw-r--r--win/makefile.vc1
7 files changed, 74 insertions, 9 deletions
diff --git a/generic/tcl.h b/generic/tcl.h
index 1cd2c43..71b1930 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -2298,7 +2298,7 @@ typedef int (Tcl_NRPostProc) (ClientData data[], Tcl_Interp *interp,
* stubs tables.
*/
-#define TCL_STUB_MAGIC ((int) 0xFCA3BACB + sizeof(TCL_SIZE_T))
+#define TCL_STUB_MAGIC ((int) (0xFCA3BACB + sizeof(size_t)))
/*
* The following function is required to be defined in all stubs aware
@@ -2325,10 +2325,6 @@ const char * TclTomMathInitializeStubs(Tcl_Interp *interp,
#endif
/*
- * TODO - tommath stubs export goes here!
- */
-
-/*
* Public functions that are not accessible via the stubs table.
* Tcl_GetMemoryInfo is needed for AOLserver. [Bug 1868171]
*/
diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c
index af1aade..c2704a0 100755
--- a/generic/tclStrToD.c
+++ b/generic/tclStrToD.c
@@ -525,7 +525,6 @@ TclParseNumber(
char d = 0; /* Last hexadecimal digit scanned; initialized
* to avoid a compiler warning. */
int shift = 0; /* Amount to shift when accumulating binary */
- int explicitOctal = 0;
#define ALL_BITS (~(Tcl_WideUInt)0)
#define MOST_BITS (ALL_BITS >> 1)
@@ -637,7 +636,6 @@ TclParseNumber(
goto zerob;
}
if (c == 'o' || c == 'O') {
- explicitOctal = 1;
state = ZERO_O;
break;
}
diff --git a/generic/tclStubLib.c b/generic/tclStubLib.c
index 8c99a70..bd80ec1 100644
--- a/generic/tclStubLib.c
+++ b/generic/tclStubLib.c
@@ -34,7 +34,8 @@ const TclIntPlatStubs *tclIntPlatStubsPtr = NULL;
static const TclStubs *
HasStubSupport(
- Tcl_Interp *interp, int magic)
+ Tcl_Interp *interp,
+ int magic)
{
Interp *iPtr = (Interp *) interp;
diff --git a/generic/tclStubLibCompat.c b/generic/tclStubLibCompat.c
new file mode 100644
index 0000000..7d8c5c3
--- /dev/null
+++ b/generic/tclStubLibCompat.c
@@ -0,0 +1,57 @@
+/*
+ * tclStubLibCompat.c --
+ *
+ * Stub object that will be statically linked into extensions that want
+ * to access Tcl.
+ *
+ * Copyright (c) 2012 Jan Nijtmans
+ *
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+/*
+ * Small wrapper, which allows Tcl8 extensions to use the same stub
+ * library as Tcl 9.
+ */
+
+#include "tclInt.h"
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_InitStubs --
+ *
+ * Tries to initialise the stub table pointers and ensures that the
+ * correct version of Tcl is loaded.
+ *
+ * Results:
+ * The actual version of Tcl that satisfies the request, or NULL to
+ * indicate that an error occurred.
+ *
+ * Side effects:
+ * Sets the stub table pointers.
+ *
+ *----------------------------------------------------------------------
+ */
+#undef Tcl_InitStubs
+
+MODULE_SCOPE const char *
+Tcl_InitStubs(
+ Tcl_Interp *interp,
+ const char *version,
+ int exact)
+{
+ /* Use the hardcoded Tcl8 magic value here. */
+ return TclInitStubs(interp, version, exact, (int) 0xFCA3BACF);
+}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
+
diff --git a/unix/Makefile.in b/unix/Makefile.in
index 4f66646..9a7d6db 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -335,7 +335,11 @@ TOMMATH_OBJS = bncore.o bn_reverse.o bn_fast_s_mp_mul_digs.o \
bn_mp_unsigned_bin_size.o bn_mp_xor.o bn_mp_zero.o bn_s_mp_add.o \
bn_s_mp_mul_digs.o bn_s_mp_sqr.o bn_s_mp_sub.o
-STUB_LIB_OBJS = tclStubLib.o tclTomMathStubLib.o tclOOStubLib.o ${COMPAT_OBJS}
+STUB_LIB_OBJS = tclStubLib.o \
+ tclStubLibCompat.o \
+ tclTomMathStubLib.o \
+ tclOOStubLib.o \
+ ${COMPAT_OBJS}
UNIX_OBJS = tclUnixChan.o tclUnixEvent.o tclUnixFCmd.o \
tclUnixFile.o tclUnixPipe.o tclUnixSock.o \
@@ -468,6 +472,7 @@ OO_SRCS = \
STUB_SRCS = \
$(GENERIC_DIR)/tclStubLib.c \
+ $(GENERIC_DIR)/tclStubLibCompat.c \
$(GENERIC_DIR)/tclTomMathStubLib.c \
$(GENERIC_DIR)/tclOOStubLib.c
@@ -1656,6 +1661,9 @@ Zzutil.o: $(ZLIB_DIR)/zutil.c
tclStubLib.o: $(GENERIC_DIR)/tclStubLib.c
$(CC) -c $(STUB_CC_SWITCHES) $(GENERIC_DIR)/tclStubLib.c
+tclStubLibCompat.o: $(GENERIC_DIR)/tclStubLibCompat.c
+ $(CC) -c $(STUB_CC_SWITCHES) $(GENERIC_DIR)/tclStubLibCompat.c
+
tclTomMathStubLib.o: $(GENERIC_DIR)/tclTomMathStubLib.c
$(CC) -c $(STUB_CC_SWITCHES) $(GENERIC_DIR)/tclTomMathStubLib.c
diff --git a/win/Makefile.in b/win/Makefile.in
index dacbbb5..6b9685d 100644
--- a/win/Makefile.in
+++ b/win/Makefile.in
@@ -378,6 +378,7 @@ REG_OBJS = tclWinReg.$(OBJEXT)
STUB_OBJS = \
tclStubLib.$(OBJEXT) \
+ tclStubLibCompat.$(OBJEXT) \
tclTomMathStubLib.$(OBJEXT) \
tclOOStubLib.$(OBJEXT)
@@ -505,6 +506,9 @@ tclPkgConfig.${OBJEXT}: tclPkgConfig.c
# The following objects are part of the stub library and should not be built
# as DLL objects but none of the symbols should be exported
+tclStubLibCompat.${OBJEXT}: tclStubLibCompat.c
+ $(CC) -c $(CC_SWITCHES) -DSTATIC_BUILD @DEPARG@ $(CC_OBJNAME)
+
tclStubLib.${OBJEXT}: tclStubLib.c
$(CC) -c $(CC_SWITCHES) -DSTATIC_BUILD @DEPARG@ $(CC_OBJNAME)
diff --git a/win/makefile.vc b/win/makefile.vc
index 2784140..823142f 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -448,6 +448,7 @@ TCLOBJS = $(COREOBJS) $(ZLIBOBJS) $(TOMMATHOBJS) $(PLATFORMOBJS)
TCLSTUBOBJS = \
$(TMP_DIR)\tclStubLib.obj \
+ $(TMP_DIR)\tclStubLibCompat.obj \
$(TMP_DIR)\tclTomMathStubLib.obj \
$(TMP_DIR)\tclOOStubLib.obj