Commit 978119ba authored by qrczak's avatar qrczak

[project @ 2001-01-13 20:33:51 by qrczak]

Use a replacement for LINE pragmas under nhc.
parent 7c2f3fa9
-----------------------------------------------------------------------------
-- $Id: Main.hs,v 1.10 2001/01/13 19:46:49 qrczak Exp $
-- $Id: Main.hs,v 1.11 2001/01/13 20:33:51 qrczak Exp $
--
-- (originally "GlueHsc.hs" by Marcin 'Qrczak' Kowalczyk)
--
......@@ -409,7 +409,7 @@ outCLine pos =
outHsLine :: SourcePos -> String
outHsLine pos =
" printf (\"{-# LINE %d \\\"%s\\\" #-}\\n\", "++
" hsc_line ("++
show (sourceLine pos + 1)++", \""++
showCString (sourceFileName pos)++"\");\n"
......
......@@ -11,6 +11,14 @@
#define offsetof(t, f) ((size_t) &((t *)0)->f)
#endif
#if __NHC__
#define hsc_line(line, file) \
printf ("# %d \"%s\"\n", line, file);
#else
#define hsc_line(line, file) \
printf ("{-# LINE %d \"%s\" #-}\n", line, file);
#endif
#define hsc_const(x) \
if ((x) < 0) \
printf ("%ld", (long)(x)); \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment