patch 9.0.1390: FOR_ALL_ macros are defined in an unexpected file
Problem: FOR_ALL_ macros are defined in an unexpected file.
Solution: Move FOR_ALL_ macros to macros.h. Add FOR_ALL_HASHTAB_ITEMS.
(Yegappan Lakshmanan, closes #12109)
diff --git a/src/spellfile.c b/src/spellfile.c
index a9fa70c..85956b7 100644
--- a/src/spellfile.c
+++ b/src/spellfile.c
@@ -3466,7 +3466,7 @@
for (ht = &aff->af_pref; ; ht = &aff->af_suff)
{
todo = (int)ht->ht_used;
- for (hi = ht->ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(ht, hi, todo)
{
if (!HASHITEM_EMPTY(hi))
{
@@ -5117,7 +5117,7 @@
hashitem_T *hi;
todo = (int)spin->si_commonwords.ht_used;
- for (hi = spin->si_commonwords.ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(&spin->si_commonwords, hi, todo)
if (!HASHITEM_EMPTY(hi))
{
l = (int)STRLEN(hi->hi_key) + 1;