support weak attribute on variables
This commit is contained in:
7
tccgen.c
7
tccgen.c
@ -2922,6 +2922,9 @@ static int parse_btype(CType *type, AttributeDef *ad)
|
||||
case TOK_ATTRIBUTE1:
|
||||
case TOK_ATTRIBUTE2:
|
||||
parse_attribute(ad);
|
||||
if (ad->weak) {
|
||||
t |= VT_WEAK;
|
||||
}
|
||||
if (ad->mode) {
|
||||
u = ad->mode -1;
|
||||
t = (t & ~VT_BTYPE) | u;
|
||||
@ -3189,6 +3192,10 @@ static void type_decl(CType *type, AttributeDef *ad, int *v, int td)
|
||||
post_type(type, ad);
|
||||
if (tok == TOK_ATTRIBUTE1 || tok == TOK_ATTRIBUTE2)
|
||||
parse_attribute(ad);
|
||||
|
||||
if (ad->weak)
|
||||
type->t |= VT_WEAK;
|
||||
|
||||
if (!type1.t)
|
||||
return;
|
||||
/* append type at the end of type1 */
|
||||
|
||||
Reference in New Issue
Block a user