diff options
| author | grischka <grischka> | 2017-07-14 19:26:01 +0200 |
|---|---|---|
| committer | grischka <grischka> | 2017-07-14 19:26:01 +0200 |
| commit | 69a137ff889f552b3ce58b861f3f0601c1818d6b (patch) | |
| tree | 8e2f2e4a2274e48a9e7bbafd37c4f06d8389b723 /tccpp.c | |
| parent | 04418c7addb757e80b09c94eb3553b131bcf4de8 (diff) | |
| download | tinycc-69a137ff889f552b3ce58b861f3f0601c1818d6b.tar.gz tinycc-69a137ff889f552b3ce58b861f3f0601c1818d6b.tar.bz2 | |
#pragma comment(option,"-..."), bitfields test, etc...
tccpp.c:
* #pragma comment(option,"-some-option")
to set commandline option from C code. May work only
for some options.
libtcc.c:
* option "-d1..9": sets a 'g_debug' global variable.
(for development)
tests2/Makefile:
* new make targets: tests2.37 / tests2.37+
run single test from tests2, optionally update .expect
* new variable GEN-ALWAYS to always generate certain .expects
* bitfields test
tccgen.c:
* bitfields: fix a bug and improve slightly more
* _Generic: ignore "type match twice"
Diffstat (limited to 'tccpp.c')
| -rw-r--r-- | tccpp.c | 22 |
1 files changed, 13 insertions, 9 deletions
@@ -1658,24 +1658,28 @@ static void pragma_parse(TCCState *s1) goto pragma_err; } else if (tok == TOK_comment) { - char *file; + char *p; int t; next(); skip('('); - if (tok != TOK_lib) - goto pragma_warn; + t = tok; next(); skip(','); if (tok != TOK_STR) goto pragma_err; - file = tcc_strdup((char *)tokc.str.data); - dynarray_add(&s1->pragma_libs, &s1->nb_pragma_libs, file); + p = tcc_strdup((char *)tokc.str.data); next(); if (tok != ')') goto pragma_err; - } else { -pragma_warn: - if (s1->warn_unsupported) - tcc_warning("#pragma %s is ignored", get_tok_str(tok, &tokc)); + if (t == TOK_lib) { + dynarray_add(&s1->pragma_libs, &s1->nb_pragma_libs, p); + } else { + if (t == TOK_option) + tcc_set_options(s1, p); + tcc_free(p); + } + + } else if (s1->warn_unsupported) { + tcc_warning("#pragma %s is ignored", get_tok_str(tok, &tokc)); } return; |
