summaryrefslogtreecommitdiffstats
path: root/generic/tkInt.h
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkInt.h')
-rw-r--r--generic/tkInt.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/generic/tkInt.h b/generic/tkInt.h
index c91b6d8..74f2501 100644
--- a/generic/tkInt.h
+++ b/generic/tkInt.h
@@ -1372,7 +1372,11 @@ MODULE_SCOPE void TkRotatePoint(double originX, double originY,
double *yPtr);
MODULE_SCOPE int TkGetIntForIndex(Tcl_Obj *, TkSizeT, int lastOK, TkSizeT*);
-#define TkNewIndexObj(value) Tcl_NewWideIntObj((Tcl_WideInt)(value + 1) - 1)
+#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9)
+# define TkNewIndexObj(value) Tcl_NewWideIntObj((Tcl_WideInt)(value + 1) - 1)
+#else
+# define TkNewIndexObj(value) (((value) == TCL_INDEX_NONE) ? Tcl_NewObj() : Tcl_NewWideIntObj(value))
+#endif
#ifdef _WIN32
#define TkParseColor XParseColor