summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--c.zig1
-rw-r--r--c/loadable_extension.zig1
-rw-r--r--c/workaround.c5
-rw-r--r--c/workaround.h3
4 files changed, 10 insertions, 0 deletions
diff --git a/c.zig b/c.zig
index 4589aef..3a43106 100644
--- a/c.zig
+++ b/c.zig
@@ -5,6 +5,7 @@ pub const c = if (@hasDecl(root, "loadable_extension"))
5else 5else
6 @cImport({ 6 @cImport({
7 @cInclude("sqlite3.h"); 7 @cInclude("sqlite3.h");
8 @cInclude("workaround.h");
8 }); 9 });
9 10
10// versionGreaterThanOrEqualTo returns true if the SQLite version is >= to the major.minor.patch provided. 11// versionGreaterThanOrEqualTo returns true if the SQLite version is >= to the major.minor.patch provided.
diff --git a/c/loadable_extension.zig b/c/loadable_extension.zig
index 4b27534..fdfe15e 100644
--- a/c/loadable_extension.zig
+++ b/c/loadable_extension.zig
@@ -1,5 +1,6 @@
1const c = @cImport({ 1const c = @cImport({
2 @cInclude("loadable-ext-sqlite3ext.h"); 2 @cInclude("loadable-ext-sqlite3ext.h");
3 @cInclude("workaround.h");
3}); 4});
4 5
5pub usingnamespace c; 6pub usingnamespace c;
diff --git a/c/workaround.c b/c/workaround.c
new file mode 100644
index 0000000..592d33d
--- /dev/null
+++ b/c/workaround.c
@@ -0,0 +1,5 @@
1#include "workaround.h"
2
3my_sqlite3_destructor_type sqliteTransientAsDestructor() {
4 return (my_sqlite3_destructor_type)-1;
5}
diff --git a/c/workaround.h b/c/workaround.h
new file mode 100644
index 0000000..ae243b8
--- /dev/null
+++ b/c/workaround.h
@@ -0,0 +1,3 @@
1typedef void (*my_sqlite3_destructor_type)(void *);
2
3my_sqlite3_destructor_type sqliteTransientAsDestructor();