diff options
| author | Steffen Nurpmeso <steffen@sdaoden.eu> | 2017-09-30 00:13:05 +0200 |
|---|---|---|
| committer | Steffen Nurpmeso <steffen@sdaoden.eu> | 2017-10-03 17:58:45 +0200 |
| commit | 1d5e386b0a78393ac6b670c209a185849ec798a1 (patch) | |
| tree | 6f01f1f94079d73ee45caefe3ea3fa4ae5ecac61 /libtcc.c | |
| parent | a1c90513131164500f503108a845fee1e8632cc6 (diff) | |
| download | tinycc-1d5e386b0a78393ac6b670c209a185849ec798a1.tar.gz tinycc-1d5e386b0a78393ac6b670c209a185849ec798a1.tar.bz2 | |
Introduce VIP sysinclude paths which are always searched first
Diffstat (limited to 'libtcc.c')
| -rw-r--r-- | libtcc.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -906,6 +906,7 @@ LIBTCCAPI void tcc_delete(TCCState *s1) /* free include paths */ dynarray_reset(&s1->cached_includes, &s1->nb_cached_includes); + dynarray_reset(&s1->tccinclude_paths, &s1->nb_tccinclude_paths); dynarray_reset(&s1->include_paths, &s1->nb_include_paths); dynarray_reset(&s1->sysinclude_paths, &s1->nb_sysinclude_paths); dynarray_reset(&s1->cmd_include_files, &s1->nb_cmd_include_files); @@ -946,6 +947,7 @@ LIBTCCAPI int tcc_set_output_type(TCCState *s, int output_type) if (!s->nostdinc) { /* default include paths */ /* -isystem paths have already been handled */ + tcc_add_tccinclude_path(s, CONFIG_TCC_TCCINCLUDEPATHS); tcc_add_sysinclude_path(s, CONFIG_TCC_SYSINCLUDEPATHS); } @@ -983,6 +985,12 @@ LIBTCCAPI int tcc_set_output_type(TCCState *s, int output_type) return 0; } +LIBTCCAPI int tcc_add_tccinclude_path(TCCState *s, const char *pathname) +{ + tcc_split_path(s, &s->tccinclude_paths, &s->nb_tccinclude_paths, pathname); + return 0; +} + LIBTCCAPI int tcc_add_include_path(TCCState *s, const char *pathname) { tcc_split_path(s, &s->include_paths, &s->nb_include_paths, pathname); @@ -1821,7 +1829,7 @@ reparse: break; case TCC_OPTION_iwithprefix: snprintf(buf, sizeof buf, "{B}/%s", optarg); - tcc_add_sysinclude_path(s, buf); + tcc_add_tccinclude_path(s, buf); break; case TCC_OPTION_include: dynarray_add(&s->cmd_include_files, |
