fix a preprocessor for .S

* tell a right line number in error message
      if a #line directive is wrong

    * don't print an error message if we preprocess a .S file
      and #line directive is wrong. This is the case of
      the
        # 4026 bytes
      comment in *.S file.

    * preprocess_skip: skip a line with
	    if (parse_flags & PARSE_FLAG_ASM_COMMENTS)
       		p = parse_line_comment(p);
      if line starts with # and a preprocessor command not found.

      A test program:
      #if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)
	# This repeats until either a device doesn't exist, or until
      #endif

    * remove a second definition of the TOK_FLAG_* and PARSE_FLAG_*
      from the tccpp.c
This commit is contained in:
seyko
2015-04-10 16:31:12 +03:00
parent 559675b90a
commit 70dbe169b2
2 changed files with 15 additions and 19 deletions

View File

@ -1177,13 +1177,13 @@ ST_FUNC int tcc_add_file_internal(TCCState *s1, const char *filename, int flags)
#ifdef CONFIG_TCC_ASM
if (!strcmp(ext, "S")) {
/* preprocessed assembler */
/* non preprocessed assembler */
ret = tcc_assemble(s1, 1);
goto the_end;
}
if (!strcmp(ext, "s")) {
/* non preprocessed assembler */
/* preprocessed assembler */
ret = tcc_assemble(s1, 0);
goto the_end;
}