mirror of
https://github.com/sbrow/envr.git
synced 2026-06-27 18:48:33 -04:00
feat: zig-sqlite.
This commit is contained in:
20
zig-vendor/zig-sqlite/c.zig
Normal file
20
zig-vendor/zig-sqlite/c.zig
Normal file
@@ -0,0 +1,20 @@
|
||||
const root = @import("root");
|
||||
|
||||
pub const c = if (@hasDecl(root, "loadable_extension"))
|
||||
@import("c/loadable_extension.zig")
|
||||
else
|
||||
@cImport({
|
||||
@cInclude("sqlite3.h");
|
||||
@cInclude("workaround.h");
|
||||
});
|
||||
|
||||
// versionGreaterThanOrEqualTo returns true if the SQLite version is >= to the major.minor.patch provided.
|
||||
pub fn versionGreaterThanOrEqualTo(major: u8, minor: u8, patch: u8) bool {
|
||||
return c.SQLITE_VERSION_NUMBER >= @as(u32, major) * 1000000 + @as(u32, minor) * 1000 + @as(u32, patch);
|
||||
}
|
||||
|
||||
comptime {
|
||||
if (!versionGreaterThanOrEqualTo(3, 21, 0)) {
|
||||
@compileError("must use SQLite >= 3.21.0");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user