Import Tcl 8.6.11
This commit is contained in:
@@ -59,15 +59,15 @@ typedef struct String {
|
||||
* space allocated for the unicode array. */
|
||||
int hasUnicode; /* Boolean determining whether the string has
|
||||
* a Unicode representation. */
|
||||
Tcl_UniChar unicode[1]; /* The array of Unicode chars. The actual size
|
||||
Tcl_UniChar unicode[TCLFLEXARRAY]; /* The array of Unicode chars. The actual size
|
||||
* of this field depends on the 'maxChars'
|
||||
* field above. */
|
||||
} String;
|
||||
|
||||
#define STRING_MAXCHARS \
|
||||
(int)(((size_t)UINT_MAX - sizeof(String))/sizeof(Tcl_UniChar))
|
||||
(int)(((size_t)UINT_MAX - 1 - TclOffset(String, unicode))/sizeof(Tcl_UniChar))
|
||||
#define STRING_SIZE(numChars) \
|
||||
(sizeof(String) + ((numChars) * sizeof(Tcl_UniChar)))
|
||||
(TclOffset(String, unicode) + ((numChars + 1) * sizeof(Tcl_UniChar)))
|
||||
#define stringCheckLimits(numChars) \
|
||||
do { \
|
||||
if ((numChars) < 0 || (numChars) > STRING_MAXCHARS) { \
|
||||
|
||||
Reference in New Issue
Block a user