C FFI: fix line offset in gcc errors on custom header code
authorAlexis Laferrière <alexis.laf@xymus.net>
Sun, 25 Jan 2015 17:55:47 +0000 (12:55 -0500)
committerAlexis Laferrière <alexis.laf@xymus.net>
Tue, 27 Jan 2015 03:08:06 +0000 (22:08 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

src/ffi/c.nit

index ebd2277..1790f48 100644 (file)
@@ -31,11 +31,13 @@ class CLanguage
        redef fun compile_module_block(block, ecc, mmodule)
        do
                if block.is_c_header then
-                       ecc.header_custom.add( block.location.as_line_pragma )
-                       ecc.header_custom.add( block.code )
+                       ecc.header_custom.add block.location.as_line_pragma
+                       ecc.header_custom.add "\n"
+                       ecc.header_custom.add block.code
                else if block.is_c_body then
-                       ecc.body_custom.add( block.location.as_line_pragma )
-                       ecc.body_impl.add( block.code )
+                       ecc.body_impl.add block.location.as_line_pragma
+                       ecc.body_impl.add "\n"
+                       ecc.body_impl.add block.code
                end
        end