From cb73be5346a78bdfa76c7075092f04ec425ecb7e Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Mon, 17 Jun 2019 20:52:09 +0200 Subject: [PATCH] Fix last commit it wasn't complete. --- tccgen.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tccgen.c b/tccgen.c index 952df53e..3726109f 100644 --- a/tccgen.c +++ b/tccgen.c @@ -957,8 +957,12 @@ static void patch_type(Sym *sym, CType *type) /* Force external definition if unequal inline specifier or an explicit extern one. */ - if ((type->t & VT_INLINE) != (sym->type.t & VT_INLINE) - || (type->t | sym->type.t) & VT_EXTERN) { + if ((sym->type.t | type->t) & VT_STATIC) { + type->t |= sym->type.t & VT_INLINE; + sym->type.t |= type->t & VT_INLINE; + } else if (((type->t & VT_INLINE) != (sym->type.t & VT_INLINE) + || (type->t | sym->type.t) & VT_EXTERN) + && !static_proto) { type->t &= ~VT_INLINE; sym->type.t &= ~VT_INLINE; }