libtcc: cleanup @listfile

Also:
- allow more than one item per line
- respect "quoted items" and escaped quotes \"
  (also for LIBTCCAPI tcc_setoptions)

- cleanup some copy & paste
This commit is contained in:
grischka
2016-10-01 20:19:37 +02:00
parent 09a487eb2b
commit eacdc426d7
5 changed files with 143 additions and 172 deletions

16
tcc.h
View File

@ -638,14 +638,6 @@ struct sym_attr {
#endif
};
typedef struct ParseArgsState
{
int run;
int pthread;
int filetype;
CString linker_arg; /* collect -Wl options for input such as "-Wl,-rpath -Wl,<path>" */
} ParseArgsState;
#if !defined(MEM_DEBUG)
#define tal_free(al, p) tal_free_impl(al, p)
#define tal_realloc(al, p, size) tal_realloc_impl(&al, p, size)
@ -682,6 +674,7 @@ typedef struct tal_header_t {
#endif
} tal_header_t;
struct TCCState {
int verbose; /* if true, display some information during compilation */
@ -860,7 +853,10 @@ struct TCCState {
int do_bench; /* option -bench */
int gen_deps; /* option -MD */
char *deps_outfile; /* option -MF */
ParseArgsState *parse_args_state;
int args_pthread; /* -pthread option */
CString linker_arg; /* collect -Wl options for input such as "-Wl,-rpath -Wl,<path>" */
int args_ref; /* tcc_parse_args recursive counter */
};
struct filespec {
@ -1312,8 +1308,6 @@ ST_FUNC void preprocess_delete(void);
ST_FUNC int tcc_preprocess(TCCState *s1);
ST_FUNC void skip(int c);
ST_FUNC NORETURN void expect(const char *msg);
ST_FUNC char *trimfront(char *p);
ST_FUNC char *trimback(char *a, char *e);
/* ------------ tccgen.c ------------ */