summaryrefslogtreecommitdiffstats
path: root/generic/tcl.h
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-07-08 09:46:01 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-07-08 09:46:01 (GMT)
commitd5259dab0165d9c7445e14676e009bb55213aace (patch)
tree6d895f484691ec4c5b4b0ea200cd4297ffd21ea6 /generic/tcl.h
parent26562de08390bae627d1602206683fae653f0c25 (diff)
downloadtcl-d5259dab0165d9c7445e14676e009bb55213aace.zip
tcl-d5259dab0165d9c7445e14676e009bb55213aace.tar.gz
tcl-d5259dab0165d9c7445e14676e009bb55213aace.tar.bz2
Use TCL_HASH_TYPE #define for compatibility with Tcl8 in stead of TCL_HASH_KEY_TYPE_VERSION_2
Diffstat (limited to 'generic/tcl.h')
-rw-r--r--generic/tcl.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/generic/tcl.h b/generic/tcl.h
index cf43ff0..dd2848a 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -936,11 +936,15 @@ typedef struct Tcl_DString {
* Forward declarations of Tcl_HashTable and related types.
*/
+#ifndef TCL_HASH_TYPE
+# define TCL_HASH_TYPE size_t
+#endif
+
typedef struct Tcl_HashKeyType Tcl_HashKeyType;
typedef struct Tcl_HashTable Tcl_HashTable;
typedef struct Tcl_HashEntry Tcl_HashEntry;
-typedef size_t (Tcl_HashKeyProc) (Tcl_HashTable *tablePtr, void *keyPtr);
+typedef TCL_HASH_TYPE (Tcl_HashKeyProc) (Tcl_HashTable *tablePtr, void *keyPtr);
typedef int (Tcl_CompareHashKeysProc) (void *keyPtr, Tcl_HashEntry *hPtr);
typedef Tcl_HashEntry * (Tcl_AllocHashEntryProc) (Tcl_HashTable *tablePtr,
void *keyPtr);
@@ -992,7 +996,6 @@ struct Tcl_HashEntry {
*/
#define TCL_HASH_KEY_TYPE_VERSION 1
-#define TCL_HASH_KEY_TYPE_VERSION_2 2
struct Tcl_HashKeyType {
int version; /* Version of the table. If this structure is
@@ -1052,7 +1055,7 @@ struct Tcl_HashTable {
* table. */
size_t rebuildSize; /* Enlarge table when numEntries gets to be
* this large. */
- size_t mask; /* Mask value used in hashing function. */
+ TCL_HASH_TYPE mask1; /* Mask value used in hashing function. */
int downShift; /* Shift count used in hashing function.
* Designed to use high-order bits of
* randomized keys. */