-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Patch SQLite to silence spurious C warnings and fix data race in sqli…
…te3_last_insert_rowid() (#47)
- Loading branch information
Showing
3 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
diff --git a/Sources/CSQLite/sqlite3.c b/Sources/CSQLite/sqlite3.c | ||
index 536e9b1..01a3eb8 100644 | ||
--- a/Sources/CSQLite/sqlite3.c | ||
+++ b/Sources/CSQLite/sqlite3.c | ||
@@ -1,3 +1,5 @@ | ||
+#pragma clang diagnostic ignored "-Wambiguous-macro" | ||
+#pragma clang diagnostic ignored "-Wshorten-64-to-32" | ||
/****************************************************************************** | ||
** This file is an amalgamation of many separate C source files from SQLite | ||
** version 3.41.2. By combining all the individual C code files into this | ||
@@ -165427,7 +165429,10 @@ SQLITE_API sqlite_int64 sqlite3_last_insert_rowid(sqlite3 *db){ | ||
return 0; | ||
} | ||
#endif | ||
- return db->lastRowid; | ||
+ sqlite3_mutex_enter(db->mutex); | ||
+ i64 lastRowId = db->lastRowid; | ||
+ sqlite3_mutex_leave(db->mutex); | ||
+ return lastRowId; | ||
} | ||
/* | ||
** Set the value returned by the sqlite_nio_sqlite3_last_insert_rowid() API function. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters