diff options
| author | Joe Soroka <gits@joesoroka.com> | 2011-02-24 09:24:02 -0800 |
|---|---|---|
| committer | Joe Soroka <gits@joesoroka.com> | 2011-02-24 09:24:02 -0800 |
| commit | bec84fa00a4c4b2fab34e49fb8308e372c734709 (patch) | |
| tree | 9e2a9dab07e1af8f3c1aec8dedeca1f2126355eb /tccasm.c | |
| parent | 15b8a5709655b7f64e0c25f4cbf34887134cfed9 (diff) | |
| download | tinycc-bec84fa00a4c4b2fab34e49fb8308e372c734709.tar.gz tinycc-bec84fa00a4c4b2fab34e49fb8308e372c734709.tar.bz2 | |
tccasm: support alternate .type syntaxes
Diffstat (limited to 'tccasm.c')
| -rw-r--r-- | tccasm.c | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -601,8 +601,7 @@ static void asm_parse_directive(TCCState *s1) case TOK_ASM_type: { Sym *sym; - char newtype[64]; - newtype[0] = 0; + const char *newtype; next(); sym = label_find(tok); @@ -613,13 +612,15 @@ static void asm_parse_directive(TCCState *s1) next(); skip(','); - skip('@'); - if (tok == TOK_STR) - pstrcat(newtype, sizeof(newtype), tokc.cstr->data); - else - pstrcat(newtype, sizeof(newtype), get_tok_str(tok, NULL)); + if (tok == TOK_STR) { + newtype = tokc.cstr->data; + } else { + if (tok == '@' || tok == '%') + skip(tok); + newtype = get_tok_str(tok, NULL); + } - if (!strcmp(newtype, "function")) { + if (!strcmp(newtype, "function") || !strcmp(newtype, "STT_FUNC")) { sym->type.t = VT_FUNC; } else if (s1->warn_unsupported) |
