summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-01-25 14:51:08 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-01-25 14:51:08 (GMT)
commitbfed58b030fcbad9ec232ecc48a43e637022e307 (patch)
treee2e39fd181af321f717fb88745129bc4b140517c
parente6800a165c2e96c29916eea6a1e97d997e2c736c (diff)
downloadtcl-bfed58b030fcbad9ec232ecc48a43e637022e307.zip
tcl-bfed58b030fcbad9ec232ecc48a43e637022e307.tar.gz
tcl-bfed58b030fcbad9ec232ecc48a43e637022e307.tar.bz2
TIP #559 follow-up: Make sure that if Tcl_FreeResult() is used in an extension compiled with -DTCL_NO_DEPRECATED, this results in a link error.
Do the same with deprecated funcions from other TIP's.
-rw-r--r--generic/tclDecls.h15
-rw-r--r--generic/tclResult.c6
-rw-r--r--generic/tclStubInit.c1
3 files changed, 18 insertions, 4 deletions
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index 7386347..c487521 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -4015,7 +4015,22 @@ extern const TclStubs *tclStubsPtr;
#define Tcl_AddObjErrorInfo(interp, message, length) \
Tcl_AppendObjToErrorInfo(interp, Tcl_NewStringObj(message, length))
#ifdef TCL_NO_DEPRECATED
+#undef Tcl_FreeResult
+#undef Tcl_AppendResultVA
+#undef Tcl_AppendStringsToObjVA
+#undef Tcl_SetErrorCodeVA
+#undef Tcl_VarEvalVA
+#undef Tcl_PanicVA
#undef Tcl_GetStringResult
+#undef Tcl_GetDefaultEncodingDir
+#undef Tcl_SetDefaultEncodingDir
+#undef Tcl_UniCharLen
+#undef Tcl_UniCharNcmp
+#undef Tcl_EvalTokens
+#undef Tcl_UniCharNcasecmp
+#undef Tcl_UniCharCaseMatch
+#undef Tcl_GetMathFuncInfo
+#undef Tcl_ListMathFuncs
#define Tcl_GetStringResult(interp) Tcl_GetString(Tcl_GetObjResult(interp))
#undef Tcl_Eval
#define Tcl_Eval(interp, objPtr) \
diff --git a/generic/tclResult.c b/generic/tclResult.c
index 5c2a81f..29c5aac 100644
--- a/generic/tclResult.c
+++ b/generic/tclResult.c
@@ -853,7 +853,6 @@ SetupAppendBuffer(
Tcl_FreeResult((Tcl_Interp *) iPtr);
iPtr->result = iPtr->appendResult;
}
-#endif /* !TCL_NO_DEPRECATED */
/*
*----------------------------------------------------------------------
@@ -883,7 +882,6 @@ Tcl_FreeResult(
{
Interp *iPtr = (Interp *) interp;
-#ifndef TCL_NO_DEPRECATED
if (iPtr->freeProc != NULL) {
if (iPtr->freeProc == TCL_DYNAMIC) {
ckfree(iPtr->result);
@@ -893,10 +891,10 @@ Tcl_FreeResult(
iPtr->freeProc = 0;
}
-#endif /* !TCL_NO_DEPRECATED */
ResetObjResult(iPtr);
}
-
+#endif /* !TCL_NO_DEPRECATED */
+
/*
*----------------------------------------------------------------------
*
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index 493a272..97ef2cc 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -255,6 +255,7 @@ mp_err TclBN_mp_mul_d(const mp_int *a, unsigned int b, mp_int *c) {
# define Tcl_NewLongObj 0
# define Tcl_DbNewLongObj 0
# define Tcl_BackgroundError 0
+# define Tcl_FreeResult 0
#else
mp_err TclBN_mp_div_3(const mp_int *a, mp_int *c, unsigned int *d) {