X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=support%2Fcpp2%2Fc-ppoutput.c;h=908558354adc9ee699ce8062800c945b5dc8d922;hb=d8880177eb975f240141e0b9abf3a58c3f99b1cb;hp=9a5434311ae6d9dbc2169cd97e1a546b64a01ef2;hpb=42f9b5740a20b531ffefdd4a6271f15c10b8f990;p=fw%2Fsdcc diff --git a/support/cpp2/c-ppoutput.c b/support/cpp2/c-ppoutput.c index 9a543431..90855835 100644 --- a/support/cpp2/c-ppoutput.c +++ b/support/cpp2/c-ppoutput.c @@ -245,7 +245,8 @@ print_line (source_location src_loc, const char *special_flags) const struct line_map *map = linemap_lookup (&line_table, src_loc); size_t to_file_len = strlen (map->to_file); - unsigned char *to_file_quoted = alloca (to_file_len * 4 + 1); + unsigned char *to_file_quoted = + (unsigned char *) alloca (to_file_len * 4 + 1); unsigned char *p; print.src_line = SOURCE_LINE (map, src_loc); @@ -322,7 +323,8 @@ cb_define (cpp_reader *pfile, source_location line, cpp_hashnode *node) fputs ((const char *) NODE_NAME (node), print.outf); putc ('\n', print.outf); - print.src_line++; + if (linemap_lookup (&line_table, line)->to_line != 0) + print.src_line++; } static void @@ -367,7 +369,8 @@ void pp_dir_change (cpp_reader *pfile ATTRIBUTE_UNUSED, const char *dir) { size_t to_file_len = strlen (dir); - unsigned char *to_file_quoted = alloca (to_file_len * 4 + 1); + unsigned char *to_file_quoted = + (unsigned char *) alloca (to_file_len * 4 + 1); unsigned char *p; /* cpp_quote_string does not nul-terminate, so we have to do it ourselves. */ @@ -453,4 +456,4 @@ cb_read_pch (cpp_reader *pfile, const char *name, fprintf (print.outf, "#pragma GCC pch_preprocess \"%s\"\n", name); print.src_line++; } -#endif \ No newline at end of file +#endif