libtcc: cleanup -x<filetype> switch code

Abusing filename[0] as type is just too much of a hack.
-- From 0536407204
This commit is contained in:
grischka
2016-10-01 20:04:58 +02:00
parent e630113771
commit 09a487eb2b
4 changed files with 34 additions and 39 deletions

6
tcc.h
View File

@ -850,7 +850,7 @@ struct TCCState {
#endif
/* used by main and tcc_parse_args only */
char **files; /* files seen on command line */
struct filespec **files; /* files seen on command line */
int nb_files; /* number thereof */
int nb_libraries; /* number of libs thereof */
char *outfile; /* output filename */
@ -863,6 +863,10 @@ struct TCCState {
ParseArgsState *parse_args_state;
};
struct filespec {
char type, name[1];
};
/* The current value can be: */
#define VT_VALMASK 0x003f /* mask for value location, register or: */
#define VT_CONST 0x0030 /* constant in vc (must be first non register value) */