nitg/ffi: local functions in C are `static`
authorAlexis Laferrière <alexis.laf@xymus.net>
Tue, 4 Nov 2014 21:39:31 +0000 (16:39 -0500)
committerAlexis Laferrière <alexis.laf@xymus.net>
Tue, 4 Nov 2014 21:42:09 +0000 (16:42 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

src/c_tools.nit
src/ffi/java.nit

index 07934dd..af31c5f 100644 (file)
@@ -49,9 +49,9 @@ class CCompilationUnit
 
        fun add_local_function( efc : CFunction )
        do
-               body_decl.add( "{efc.signature};\n" )
-               body_impl.add( "\n" )
-               body_impl.add( efc.to_writer )
+               body_decl.add "static {efc.signature};\n"
+               body_impl.add "\n"
+               body_impl.add efc.to_writer
        end
 
        fun add_exported_function( efc : CFunction )
index f78dc37..c0070b5 100644 (file)
@@ -221,7 +221,7 @@ redef class MModule
                        jni_methods.add_all(cb.jni_methods_declaration(self))
                end
 
-               var cf = new CFunction("static void nit_ffi_with_java_register_natives(JNIEnv* env, jclass jclazz)")
+               var cf = new CFunction("void nit_ffi_with_java_register_natives(JNIEnv* env, jclass jclazz)")
                cf.exprs.add """
        nit_ffi_with_java_registered_natives = 1;