summaryrefslogtreecommitdiff
path: root/c.zig
diff options
context:
space:
mode:
Diffstat (limited to 'c.zig')
-rw-r--r--c.zig11
1 files changed, 11 insertions, 0 deletions
diff --git a/c.zig b/c.zig
index a346a3a..c15b987 100644
--- a/c.zig
+++ b/c.zig
@@ -1,3 +1,14 @@
1pub const c = @cImport({ 1pub const c = @cImport({
2 @cInclude("sqlite3.h"); 2 @cInclude("sqlite3.h");
3}); 3});
4
5// versionGreaterThanOrEqualTo returns true if the SQLite version is >= to the major.minor.patch provided.
6pub fn versionGreaterThanOrEqualTo(major: u8, minor: u8, patch: u8) bool {
7 return c.SQLITE_VERSION_NUMBER >= @as(u32, major) * 1000000 + @as(u32, minor) * 1000 + @as(u32, patch);
8}
9
10comptime {
11 if (!versionGreaterThanOrEqualTo(3, 21, 0)) {
12 @compileError("must use SQLite >= 3.21.0");
13 }
14}