History

-traditional and -iwithprefix options

seyko committed 11 years ago

Commit fca58731 parent 576aeb31 file · +27 −0Browse files

Unified · Split

libtcc.c+27−0
@@ -1703,12 +1703,14 @@ enum { · 1702 unmodified lines
17031703 TCC_OPTION_o,
17041704 TCC_OPTION_r,
17051705 TCC_OPTION_s,
1706+ TCC_OPTION_traditional,
17061707 TCC_OPTION_Wl,
17071708 TCC_OPTION_W,
17081709 TCC_OPTION_O,
17091710 TCC_OPTION_m,
17101711 TCC_OPTION_f,
17111712 TCC_OPTION_isystem,
1713+ TCC_OPTION_iwithprefix,
17121714 TCC_OPTION_nostdinc,
17131715 TCC_OPTION_nostdlib,
17141716 TCC_OPTION_print_search_dirs,
@@ -1764,12 +1766,14 @@ static const TCCOption tcc_options[] = { · 49 unmodified lines
17641766 { "rdynamic", TCC_OPTION_rdynamic, 0 },
17651767 { "r", TCC_OPTION_r, 0 },
17661768 { "s", TCC_OPTION_s, 0 },
1769+ { "traditional", TCC_OPTION_traditional, 0 },
17671770 { "Wl,", TCC_OPTION_Wl, TCC_OPTION_HAS_ARG | TCC_OPTION_NOSEP },
17681771 { "W", TCC_OPTION_W, TCC_OPTION_HAS_ARG | TCC_OPTION_NOSEP },
17691772 { "O", TCC_OPTION_O, TCC_OPTION_HAS_ARG | TCC_OPTION_NOSEP },
17701773 { "m", TCC_OPTION_m, TCC_OPTION_HAS_ARG },
17711774 { "f", TCC_OPTION_f, TCC_OPTION_HAS_ARG | TCC_OPTION_NOSEP },
17721775 { "isystem", TCC_OPTION_isystem, TCC_OPTION_HAS_ARG },
1776+ { "iwithprefix", TCC_OPTION_iwithprefix, TCC_OPTION_HAS_ARG },
17731777 { "nostdinc", TCC_OPTION_nostdinc, 0 },
17741778 { "nostdlib", TCC_OPTION_nostdlib, 0 },
17751779 { "print-search-dirs", TCC_OPTION_print_search_dirs, 0 },
@@ -1971,6 +1975,27 @@ PUB_FUNC int tcc_parse_args(TCCState *s, int argc, char **argv) · 195 unmodified lines
19711975 case TCC_OPTION_isystem:
19721976 tcc_add_sysinclude_path(s, optarg);
19731977 break;
1978+ case TCC_OPTION_iwithprefix:
1979+ if (1) {
1980+ char buf[1024];
1981+ int buf_size = sizeof(buf)-1;
1982+ char *p = &buf[0];
1983+
1984+ char *sysroot = "{B}/";
1985+ int len = strlen(sysroot);
1986+ if (len > buf_size)
1987+ len = buf_size;
1988+ strncpy(p, sysroot, len);
1989+ p += len;
1990+ buf_size -= len;
1991+
1992+ len = strlen(optarg);
1993+ if (len > buf_size)
1994+ len = buf_size;
1995+ strncpy(p, optarg, len+1);
1996+ tcc_add_sysinclude_path(s, buf);
1997+ }
1998+ break;
19741999 case TCC_OPTION_nostdinc:
19752000 s->nostdinc = 1;
19762001 break;
@@ -2031,6 +2056,8 @@ PUB_FUNC int tcc_parse_args(TCCState *s, int argc, char **argv) · 54 unmodified lines
20312056 case TCC_OPTION_s:
20322057 s->do_strip = 1;
20332058 break;
2059+ case TCC_OPTION_traditional:
2060+ break;
20342061 case TCC_OPTION_x:
20352062 if (*optarg == 'c')
20362063 filetype = TCC_FILETYPE_C;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t