Index: SQLite.Interop/src/win/interop.c ================================================================== --- SQLite.Interop/src/win/interop.c +++ SQLite.Interop/src/win/interop.c @@ -75,11 +75,11 @@ SQLITE_PRIVATE void sqlite3InteropLogCallback(void *pArg, int iCode, const char *zMsg){ sqlite3InteropDebug("INTEROP_LOG (%d) %s\n", iCode, zMsg); } #endif -#if SQLITE_VERSION_NUMBER < 3007014 +#if defined(INTEROP_LEGACY_CLOSE) || SQLITE_VERSION_NUMBER < 3007014 SQLITE_PRIVATE void * sqlite3DbMallocZero_interop(sqlite3 *db, int n) { void *p; if (db) { sqlite3_mutex_enter(db->mutex); @@ -120,11 +120,11 @@ GC gets around to calling finalize_interop() on the "bad" statement, we detect that and finish deallocating the pointer. */ SQLITE_API int WINAPI sqlite3_close_interop(sqlite3 *db) { int ret; -#if SQLITE_VERSION_NUMBER >= 3007014 +#if !defined(INTEROP_LEGACY_CLOSE) && SQLITE_VERSION_NUMBER >= 3007014 #if defined(INTEROP_DEBUG) && (INTEROP_DEBUG & INTEROP_DEBUG_CLOSE) sqlite3InteropDebug("sqlite3_close_interop(): calling sqlite3_close_v2(%p)...\n", db); #endif @@ -403,11 +403,11 @@ } SQLITE_API int WINAPI sqlite3_finalize_interop(sqlite3_stmt *stmt) { int ret; -#if SQLITE_VERSION_NUMBER >= 3007014 +#if !defined(INTEROP_LEGACY_CLOSE) && SQLITE_VERSION_NUMBER >= 3007014 #if defined(INTEROP_DEBUG) && (INTEROP_DEBUG & INTEROP_DEBUG_FINALIZE) Vdbe *p = (Vdbe *)stmt; sqlite3 *db = p->db; sqlite3InteropDebug("sqlite3_finalize_interop(): calling sqlite3_finalize(%p, %p)...\n", db, stmt); @@ -420,11 +420,11 @@ #endif return ret; #else Vdbe *p; - int ret = SQLITE_OK; + ret = SQLITE_OK; p = (Vdbe *)stmt; if (p) { sqlite3 *db = p->db; @@ -469,11 +469,11 @@ } SQLITE_API int WINAPI sqlite3_reset_interop(sqlite3_stmt *stmt) { int ret; -#if SQLITE_VERSION_NUMBER >= 3007014 +#if !defined(INTEROP_LEGACY_CLOSE) && SQLITE_VERSION_NUMBER >= 3007014 #if defined(INTEROP_DEBUG) && (INTEROP_DEBUG & INTEROP_DEBUG_RESET) sqlite3InteropDebug("sqlite3_reset_interop(): calling sqlite3_reset(%p)...\n", stmt); #endif Index: SQLite.NET.Settings.targets ================================================================== --- SQLite.NET.Settings.targets +++ SQLite.NET.Settings.targets @@ -278,10 +278,24 @@ INTEROP_DEBUG_BREAK (0x0200) --> true false + + false + $(DefineConstants);INTEROP_DEBUG + + + $(DefineConstants);INTEROP_LEGACY_CLOSE + + Index: System.Data.SQLite/UnsafeNativeMethods.cs ================================================================== --- System.Data.SQLite/UnsafeNativeMethods.cs +++ System.Data.SQLite/UnsafeNativeMethods.cs @@ -641,16 +641,18 @@ #else [DllImport(SQLITE_DLL)] #endif internal static extern SQLiteErrorCode sqlite3_close(IntPtr db); +#if !INTEROP_LEGACY_CLOSE #if !PLATFORM_COMPACTFRAMEWORK [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)] #else [DllImport(SQLITE_DLL)] #endif internal static extern SQLiteErrorCode sqlite3_close_v2(IntPtr db); /* 3.7.14+ */ +#endif #if !PLATFORM_COMPACTFRAMEWORK [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)] #else [DllImport(SQLITE_DLL)] Index: Tests/common.eagle ================================================================== --- Tests/common.eagle +++ Tests/common.eagle @@ -1754,12 +1754,12 @@ # for the interop assembly in order to be effective. For those # options, it will be assumed that it was enabled for the interop # assembly if it was enabled for the managed assembly. # foreach defineConstant [list CHECK_STATE COUNT_HANDLE INTEROP_CODEC \ - INTEROP_DEBUG INTEROP_LOG \ - INTEROP_EXTENSION_FUNCTIONS \ + INTEROP_DEBUG INTEROP_LEGACY_CLOSE \ + INTEROP_LOG INTEROP_EXTENSION_FUNCTIONS \ INTEROP_TEST_EXTENSION SQLITE_STANDARD \ USE_INTEROP_DLL] { # # NOTE: Check if the compile-time option is listed in the list of # "define constants" kept track of by the managed assembly. Index: Tests/tkt-ae5267b863.eagle ================================================================== --- Tests/tkt-ae5267b863.eagle +++ Tests/tkt-ae5267b863.eagle @@ -145,12 +145,13 @@ } -cleanup { cleanupDb $fileName unset -nocomplain result code results errors sql dataSource id db fileName } -constraints [fixConstraints {eagle monoBug28 command.sql compile.DATA\ -SQLite System.Data.SQLite !mda}] -match regexp -result {^Ok\ -System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{\}$}} +SQLite System.Data.SQLite !mda\ +!defineConstant.System.Data.SQLite.INTEROP_LEGACY_CLOSE}] -match regexp \ +-result {^Ok System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{\}$}} ############################################################################### runSQLiteTestEpilogue runTestEpilogue