From a24ede81b6ddb6e5dde72d947437baf319968ff9 Mon Sep 17 00:00:00 2001 From: simonmar Date: Wed, 20 Aug 2003 15:10:22 +0000 Subject: [PATCH] [project @ 2003-08-20 15:10:22 by simonmar] Don't drop {-# LINE #-} pragmas into the source, because it confuses CPP's line counts, making them off-by-one. GHC understands the CPP-style line pragmas anyhow. --- ghc/utils/unlit/unlit.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ghc/utils/unlit/unlit.c b/ghc/utils/unlit/unlit.c index ab3186a..78d8de0 100644 --- a/ghc/utils/unlit/unlit.c +++ b/ghc/utils/unlit/unlit.c @@ -350,7 +350,14 @@ char **argv; { /* Prefix the output with line pragmas */ if (prefix_str) { - fprintf(ostream, "#line 1 \"%s\"\n{-# LINE 1 \"%s\" #-}\n", prefix_str, prefix_str); + /* Both GHC and CPP understand the #line pragma. + * We used to throw in both a #line and a {-# LINE #-} pragma + * here, but CPP doesn't understand {-# LINE #-} so it thought + * the line numbers were off by one. We could put the {-# LINE + * #-} before the #line, but there's no point since GHC + * understands #line anyhow. --SDM 8/2003 + */ + fprintf(ostream, "#line 1 \"%s\"\n", prefix_str, prefix_str); } unlit(file, istream, ostream); -- 1.7.10.4