diff -ru unproto5/Makefile unproto-1.7/Makefile --- unproto5/Makefile 2019-03-29 18:16:34.000000000 +0100 +++ unproto-1.7/Makefile 2019-03-29 19:12:15.000000000 +0100 @@ -67,23 +68,35 @@ # length argument lists, edit the stdarg.h file provided with this # package so that it contains the proper definitions for your machine. +# Place the directive that your compiler uses for line control here. +# Some pre-ANSI compiler use "#line", but most use simply "#". +# +LINE = -DLINE=\"\#line\" + +# If your compiler's provides an stdarg.h file that is incompatible +# with unproto's one, define STDARG here: +# +STDARG = -DSTDARG + ## END CONFIGURATION STUFF SHELL = /bin/sh diff -ru unproto5/tok_io.c unproto-1.7/tok_io.c --- unproto5/tok_io.c 2019-03-29 18:16:34.000000000 +0100 +++ unproto-1.7/tok_io.c 2019-03-29 09:18:53.000000000 +0100 @@ -215,7 +216,8 @@ * all line control tokens to stdout. */ - put_str("# "); + put_str(LINE); + put_ch(' '); line = atoi(t->vstr->str); /* extract line number */ tok_flush(t); while ((t = tok_get()) && t->tokno == TOK_WSPACE) @@ -281,7 +284,7 @@ /* tok_get - get next token */ -static int last_tokno = '\n'; +static int new_line = 1; struct token *tok_get() { @@ -326,7 +329,7 @@ COLLECT(t->vstr, c, ISDOT(c)); t->tokno = TOK_OTHER; break; - } else if (c == '#' && last_tokno == '\n') { + } else if (c == '#' && new_line) { do_control(); continue; } else { @@ -358,7 +361,12 @@ break; } } - last_tokno = t->tokno; + if (t->tokno == '\n') + new_line = 1; + else if (t->tokno == TOK_WSPACE) + ; + else + new_line = 0; t->end_line = in_line; return (t); } @@ -552,7 +560,7 @@ if (last_ch != '\n') /* terminate open line */ put_nl(); if (path != out_path || line < out_line) { /* file switch or back jump */ - printf("# %d %s\n", out_line = line, out_path = path); + printf("%s %d %s\n", LINE, out_line = line, out_path = path); last_ch = '\n'; } else { /* forward jump */ while (line > out_line) diff -ru unproto5/unproto.c unproto-1.7/unproto.c --- unproto5/unproto.c 2019-03-29 18:16:34.000000000 +0100 +++ unproto-1.7/unproto.c 2019-03-29 18:19:19.000000000 +0100 @@ -147,7 +147,11 @@ /* Application-specific stuff */ #include "vstring.h" -#include "stdarg.h" +#ifdef STDARG + #include +#else + #include "stdarg.h" +#endif #include "token.h" #include "error.h" #include "symbol.h"