summaryrefslogtreecommitdiff
path: root/c.zig
diff options
context:
space:
mode:
authorGravatar Vincent Rischmann2024-04-14 19:09:23 +0200
committerGravatar Vincent Rischmann2024-04-14 19:31:53 +0200
commit9f0d2ed11dacbade3343cbe49e8f159f1d8b67f5 (patch)
tree61113afc3f62d456b6da480e3bd7ae9a7907e936 /c.zig
parentci: reenable windows (diff)
downloadzig-sqlite-9f0d2ed11dacbade3343cbe49e8f159f1d8b67f5.tar.gz
zig-sqlite-9f0d2ed11dacbade3343cbe49e8f159f1d8b67f5.tar.xz
zig-sqlite-9f0d2ed11dacbade3343cbe49e8f159f1d8b67f5.zip
c: add a workaround for SQLITE_TRANSIENT being mistranslated
See https://github.com/ziglang/zig/issues/15893 zig's translate-c creates an invalid type for SQLITE_TRANSIENT on some architectures (aarch64, riscv64 and others). We can work around this by making a C function that returns -1 cast to the proper destructor type and use that from zig (thanks https://github.com/Cloudef for mentioning this in this comment: https://github.com/ziglang/zig/issues/15893#issuecomment-1925092582)
Diffstat (limited to '')
-rw-r--r--c.zig1
1 files changed, 1 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.