Merge: Minor fixes to support the Turing cluster
authorJean Privat <jean@pryen.org>
Mon, 10 Nov 2014 23:35:15 +0000 (18:35 -0500)
committerJean Privat <jean@pryen.org>
Mon, 10 Nov 2014 23:35:15 +0000 (18:35 -0500)
Review only the last 2 commits here and ignore the first batch of commits they are from #886.

Enables testing of sqlite, jvm and all Java FFI tests on Turing.

Pull-Request: #897
Reviewed-by: Jean Privat <jean@pryen.org>

lib/jvm.nit
lib/sqlite3/native_sqlite3.nit

index 4337d9e..56080a5 100644 (file)
@@ -19,8 +19,8 @@
 #
 # See: http://docs.oracle.com/javase/1.5.0/docs/guide/jni/spec/jniTOC.html
 module jvm is
-       c_compiler_option("-I $(JAVA_HOME)/include/")
-       c_linker_option("-L $(JNI_LIB_PATH) -ljvm")
+       c_compiler_option "-I $(JAVA_HOME)/include/ -I $(JAVA_HOME)/include/linux/"
+       c_linker_option "-L $(JNI_LIB_PATH) -ljvm"
 end
 
 in "C Header" `{
index da93820..6419ea8 100644 (file)
@@ -153,7 +153,16 @@ extern class NativeSqlite3 `{sqlite3 *`}
        fun destroy do close
 
        # Close this connection
-       fun close `{ sqlite3_close_v2(recv); `}
+       fun close `{
+#if SQLITE_VERSION_NUMBER >= 3007014
+               sqlite3_close_v2(recv);
+#else
+               // A program using the older version should not rely on the garbage-collector
+               // to close its connections. They must be closed manually after the associated
+               // prepare statements have been finalized.
+               sqlite3_close(recv);
+#endif
+       `}
 
        # Execute a SQL statement
        fun exec(sql: String): Sqlite3Code import String.to_cstring `{