summaryrefslogtreecommitdiffstats
path: root/generic/tcl.h
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tcl.h')
-rw-r--r--generic/tcl.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/generic/tcl.h b/generic/tcl.h
index a88beb1..edfe082 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 unsigned
+#endif
+
typedef struct Tcl_HashKeyType Tcl_HashKeyType;
typedef struct Tcl_HashTable Tcl_HashTable;
typedef struct Tcl_HashEntry Tcl_HashEntry;
-typedef unsigned (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);
@@ -2295,10 +2299,6 @@ TCLAPI void Tcl_GetMemoryInfo(Tcl_DString *dsPtr);
/*
* Use do/while0 idiom for optimum correctness without compiler warnings.
* http://c2.com/cgi/wiki?TrivialDoWhileLoop
- *
- * Decrement refCount AFTER checking it for 0 or 1 (<2), because
- * we cannot assume anymore that refCount is a signed type; In
- * Tcl8 it was but in Tcl9 it is subject to change.
*/
# define Tcl_DecrRefCount(objPtr) \
do { \
@@ -2365,10 +2365,8 @@ TCLAPI void Tcl_GetMemoryInfo(Tcl_DString *dsPtr);
* hash tables:
*/
-#undef Tcl_FindHashEntry
#define Tcl_FindHashEntry(tablePtr, key) \
(*((tablePtr)->findProc))(tablePtr, (const char *)(key))
-#undef Tcl_CreateHashEntry
#define Tcl_CreateHashEntry(tablePtr, key, newPtr) \
(*((tablePtr)->createProc))(tablePtr, (const char *)(key), newPtr)