diff --git a/libguile/hashtab.h b/libguile/hashtab.h index 8f422b0b5..1705cf744 100644 --- a/libguile/hashtab.h +++ b/libguile/hashtab.h @@ -33,6 +33,7 @@ /* Types of weak hash tables. */ typedef enum { + SCM_WEAK_TABLE_KIND_NONE = 0, SCM_WEAK_TABLE_KIND_KEY, SCM_WEAK_TABLE_KIND_VALUE, SCM_WEAK_TABLE_KIND_BOTH @@ -51,7 +52,9 @@ typedef enum { #define SCM_HASHTABLE_DOUBLY_WEAK_P(x) \ (SCM_HASHTABLE_FLAGS (x) == SCM_WEAK_TABLE_KIND_BOTH) -#define SCM_HASHTABLE_WEAK_P(x) SCM_HASHTABLE_FLAGS (x) +#define SCM_HASHTABLE_WEAK_P(x) \ + (SCM_HASHTABLE_FLAGS (x) != SCM_WEAK_TABLE_KIND_NONE) + #define SCM_HASHTABLE_N_ITEMS(x) (SCM_HASHTABLE (x)->n_items) #define SCM_SET_HASHTABLE_N_ITEMS(x, n) (SCM_HASHTABLE (x)->n_items = n) #define SCM_HASHTABLE_INCREMENT(x) (SCM_HASHTABLE_N_ITEMS(x)++)