diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-04-18 15:46:15 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-04-18 15:46:15 (GMT) |
commit | b30e837f58e710b48963c2a537d7fc99c133264c (patch) | |
tree | 18a9c3f50bea643808f704fae800b554a715f829 /generic | |
parent | 870ad938f748380b913dc7d6e6ce5fd23d2c9010 (diff) | |
parent | db8e59ed80acf95cad3f0d0da9e36f46ae2de2d7 (diff) | |
download | tcl-b30e837f58e710b48963c2a537d7fc99c133264c.zip tcl-b30e837f58e710b48963c2a537d7fc99c133264c.tar.gz tcl-b30e837f58e710b48963c2a537d7fc99c133264c.tar.bz2 |
Merge 8.7
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tcl.h | 56 |
1 files changed, 31 insertions, 25 deletions
diff --git a/generic/tcl.h b/generic/tcl.h index 874d75f..2b53925 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -306,16 +306,30 @@ 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 < 9 -typedef int Tcl_Size; + typedef int Tcl_Size; +# define TCL_SIZE_MODIFIER "" +# define TCL_SIZE_MAX INT_MAX #else -typedef size_t Tcl_Size; -#endif + typedef size_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) @@ -450,38 +464,30 @@ typedef void (Tcl_ThreadCreateProc) (void *clientData); * string. */ -#if TCL_MAJOR_VERSION > 8 typedef struct Tcl_RegExpIndices { +#if TCL_MAJOR_VERSION > 8 Tcl_Size start; /* Character offset of first character in * match. */ Tcl_Size end; /* Character offset of first character after * the match. */ +#else + long start; + long end; +#endif } Tcl_RegExpIndices; typedef struct Tcl_RegExpInfo { Tcl_Size nsubs; /* Number of subexpressions in the compiled * expression. */ Tcl_RegExpIndices *matches; /* Array of nsubs match offset pairs. */ +#if TCL_MAJOR_VERSION > 8 Tcl_Size extendStart; /* The offset at which a subsequent match * might begin. */ -} Tcl_RegExpInfo; #else -typedef struct Tcl_RegExpIndices { - long start; /* Character offset of first character in - * match. */ - long end; /* Character offset of first character after - * the match. */ -} Tcl_RegExpIndices; - -typedef struct Tcl_RegExpInfo { - int nsubs; /* Number of subexpressions in the compiled - * expression. */ - Tcl_RegExpIndices *matches; /* Array of nsubs match offset pairs. */ - long extendStart; /* The offset at which a subsequent match - * might begin. */ + long extendStart; long reserved; /* Reserved for later use. */ -} Tcl_RegExpInfo; #endif +} Tcl_RegExpInfo; /* * Picky compilers complain if this typdef doesn't appear before the struct's @@ -1774,7 +1780,7 @@ typedef struct Tcl_Token { * TCL_TOKEN_OPERATOR - The token describes one expression operator. * An operator might be the name of a math * function such as "abs". A TCL_TOKEN_OPERATOR - * token is always preceeded by one + * token is always preceded by one * TCL_TOKEN_SUB_EXPR token for the operator's * subexpression, and is followed by zero or more * TCL_TOKEN_SUB_EXPR tokens for the operator's @@ -2014,11 +2020,11 @@ typedef struct Tcl_EncodingType { */ #ifndef TCL_UTF_MAX -#if TCL_MAJOR_VERSION > 8 -#define TCL_UTF_MAX 4 -#else -#define TCL_UTF_MAX 3 -#endif +# if TCL_MAJOR_VERSION > 8 +# define TCL_UTF_MAX 4 +# else +# define TCL_UTF_MAX 3 +# endif #endif /* |