From 09cba498b7dc23997c993c1122b0099d7a0dd5b7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Sun, 25 Jan 2015 12:55:47 -0500 Subject: [PATCH] C FFI: fix line offset in gcc errors on custom header code MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- src/ffi/c.nit | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ffi/c.nit b/src/ffi/c.nit index ebd2277..1790f48 100644 --- a/src/ffi/c.nit +++ b/src/ffi/c.nit @@ -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 -- 1.7.9.5