summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2023-04-05 11:03:35 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2023-04-05 11:03:35 (GMT)
commit3c2a7e1741bd4cba6bab6deae6c97256b04a6d79 (patch)
tree5cd27dd49b0d48f1e9a326210b91d929875cf7db /generic
parent1ab82013f2c14f4c0627dfa13fb18970b9c1db49 (diff)
downloadtcl-3c2a7e1741bd4cba6bab6deae6c97256b04a6d79.zip
tcl-3c2a7e1741bd4cba6bab6deae6c97256b04a6d79.tar.gz
tcl-3c2a7e1741bd4cba6bab6deae6c97256b04a6d79.tar.bz2
Add TCL_SIZE_MAX and TCL_SIZE_MODIFIER
Diffstat (limited to 'generic')
-rw-r--r--generic/tcl.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/generic/tcl.h b/generic/tcl.h
index 9140ec4..7ef4180 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -399,16 +399,31 @@ typedef unsigned TCL_WIDE_INT_TYPE Tcl_WideUInt;
# define TCL_Z_MODIFIER ""
# endif
#endif /* !TCL_Z_MODIFIER */
+#ifndef TCL_T_MODIFIER
+# if defined(__GNUC__) && !defined(_WIN32)
+# define TCL_T_MODIFIER "t"
+# elif defined(_WIN64)
+# define TCL_T_MODIFIER TCL_LL_MODIFIER
+# else
+# define TCL_T_MODIFIER TCL_Z_MODIFIER
+# endif
+#endif /* !TCL_T_MODIFIER */
+
#define Tcl_WideAsLong(val) ((long)((Tcl_WideInt)(val)))
#define Tcl_LongAsWide(val) ((Tcl_WideInt)((long)(val)))
#define Tcl_WideAsDouble(val) ((double)((Tcl_WideInt)(val)))
#define Tcl_DoubleAsWide(val) ((Tcl_WideInt)((double)(val)))
-#if TCL_MAJOR_VERSION > 8
-typedef size_t Tcl_Size;
+
+#if TCL_MAJOR_VERSION < 9
+ typedef int Tcl_Size;
+# define TCL_SIZE_MAX INT_MAX
+# define TCL_SIZE_MODIFIER ""
#else
-typedef int Tcl_Size;
-#endif
+ typedef ptrdiff_t Tcl_Size;
+# define TCL_SIZE_MAX PTRDIFF_MAX
+# define TCL_SIZE_MODIFIER TCL_T_MODIFIER
+#endif /* TCL_MAJOR_VERSION */
#ifdef _WIN32
# if TCL_MAJOR_VERSION > 8 || defined(_WIN64) || defined(_USE_64BIT_TIME_T)