diff --git a/tools/qfcc/include/symtab.h b/tools/qfcc/include/symtab.h index 8d8943ef7..d9bb724f0 100644 --- a/tools/qfcc/include/symtab.h +++ b/tools/qfcc/include/symtab.h @@ -104,6 +104,8 @@ typedef struct symtab_s { symbol_t **symtail; ///< keep chain in declaration order struct defspace_s *space; ///< storage for vars in scope symtabs struct class_s *class; ///< owning class if ivar scope + symbol_t *(*procsymbol) (const char *name, struct symtab_s *symtab); + void *procsymbol_data; } symtab_t; const char *symtype_str (sy_type_e type) __attribute__((const)); diff --git a/tools/qfcc/source/symtab.c b/tools/qfcc/source/symtab.c index 2226d0735..0c9b440cc 100644 --- a/tools/qfcc/source/symtab.c +++ b/tools/qfcc/source/symtab.c @@ -119,8 +119,13 @@ symtab_lookup (symtab_t *symtab, const char *name) { symbol_t *symbol; do { - if ((symbol = Hash_Find (symtab->tab, name))) + if ((symbol = Hash_Find (symtab->tab, name))) { return symbol; + } + if (symtab->procsymbol + && (symbol = symtab->procsymbol (name, symtab))) { + return symbol; + } symtab = symtab->parent; } while (symtab); return 0;