preprocess: "assign PARSE_FLAG_ASM_COMMENTS only for asm files"
resolve a problem with the following test.c program, tcc -E test.c
#ifdef _XOPEN_SOURCE
# define __USE_XOPEN 1
# if (_XOPEN_SOURCE - 0) >= 500
# define __USE_XOPEN_EXTENDED 1
# define __USE_UNIX98 1
# undef _LARGEFILE_SOURCE
# define _LARGEFILE_SOURCE 1
# if (_XOPEN_SOURCE - 0) >= 600
# define __USE_XOPEN2K 1
# undef __USE_ISOC99
# define __USE_ISOC99 1
# endif
# else
# ifdef _XOPEN_SOURCE_EXTENDED
# define __USE_XOPEN_EXTENDED 1
# endif
# endif
#endif
int main() {}
// # 17 "aaa.c"
// aaa.c:17: error: #endif without matching #if
This commit is contained in:
2
libtcc.c
2
libtcc.c
@ -1166,7 +1166,7 @@ ST_FUNC int tcc_add_file_internal(TCCState *s1, const char *filename, int flags,
|
||||
/* if .S file, define __ASSEMBLER__ like gcc does */
|
||||
if ((filetype == TCC_FILETYPE_ASM) || (filetype == TCC_FILETYPE_ASM_PP)) {
|
||||
tcc_define_symbol(s1, "__ASSEMBLER__", NULL);
|
||||
parse_flags = PARSE_FLAG_ASM_FILE;
|
||||
parse_flags = PARSE_FLAG_ASM_FILE | PARSE_FLAG_ASM_COMMENTS;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user