diff options
| -rw-r--r-- | parse.c | 5 | ||||
| -rw-r--r-- | symbol.c | 3 |
2 files changed, 5 insertions, 3 deletions
@@ -899,7 +899,8 @@ static struct token *external_declaration(struct token *token, struct symbol_lis symbol_iterate(base_type->arguments, declare_argument, decl); token = compound_statement(token->next, base_type->stmt); end_function_scope(); - add_symbol(list, decl); + if (!(decl->ctype.modifiers & MOD_INLINE)) + add_symbol(list, decl); return expect(token, '}', "at end of function"); } decl->ctype.modifiers |= MOD_EXTERN; @@ -913,7 +914,7 @@ static struct token *external_declaration(struct token *token, struct symbol_lis } token = initializer(&decl->initializer, token->next); } - if (!is_typedef && !(decl->ctype.modifiers & MOD_EXTERN)) + if (!is_typedef && !(decl->ctype.modifiers & (MOD_EXTERN | MOD_INLINE))) add_symbol(list, decl); if (!match_op(token, ',')) @@ -317,10 +317,11 @@ struct sym_init { { "union", NULL, MOD_UNIONOF }, { "enum", NULL, MOD_ENUMOF }, - /* Ignored for now.. */ { "inline", NULL, MOD_INLINE }, { "__inline", NULL, MOD_INLINE }, { "__inline__", NULL, MOD_INLINE }, + + /* Ignored for now.. */ { "restrict", NULL, 0 }, { "__restrict", NULL, 0 }, |
