treesummaryrefslogcommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.zig14
-rw-r--r--build.zig.zon3
-rw-r--r--src/db.zig4
3 files changed, 12 insertions, 9 deletions
diff --git a/build.zig b/build.zig
index 572a55c..79d8d8f 100644
--- a/build.zig
+++ b/build.zig
@@ -18,13 +18,13 @@ pub fn build(b: *std.Build) void {
const db = b.addModule("db", .{
.root_source_file = b.path("src/db.zig"),
+ .target = target,
+ .optimize = optimize,
});
db.addImport("lmdb", lmdb);
const lmdb_tests = b.addTest(.{
- .root_source_file = b.path("src/lmdb.zig"),
- .target = target,
- .optimize = optimize,
+ .root_module = lmdb,
});
lmdb_tests.addIncludePath(b.path("lmdb"));
lmdb_tests.addCSourceFiles(.{ .files = &.{
@@ -34,9 +34,7 @@ pub fn build(b: *std.Build) void {
lmdb_tests.linkLibC();
const db_tests = b.addTest(.{
- .root_source_file = b.path("src/db.zig"),
- .target = target,
- .optimize = optimize,
+ .root_module = db,
});
db_tests.root_module.addImport("lmdb", lmdb);
@@ -54,4 +52,8 @@ pub fn build(b: *std.Build) void {
test_step.dependOn(&db_tests.step);
test_step.dependOn(&lmdb_test_bin.step);
test_step.dependOn(&db_test_bin.step);
+
+ const check = b.step("check", "Check if ziglmdb compiles");
+ check.dependOn(&lmdb_tests.step);
+ check.dependOn(&db_tests.step);
}
diff --git a/build.zig.zon b/build.zig.zon
index cf95235..271425e 100644
--- a/build.zig.zon
+++ b/build.zig.zon
@@ -1,6 +1,7 @@
.{
- .name = "lmdb",
+ .name = .lmdb,
.version = "0.0.0",
+ .fingerprint = 0xb296610351cd9899,
.paths = .{
"src/lmdb.zig",
"src/db.zig",
diff --git a/src/db.zig b/src/db.zig
index 3e1b186..99d3eb3 100644
--- a/src/db.zig
+++ b/src/db.zig
@@ -180,8 +180,8 @@ fn SetListViewBase(comptime K: type, comptime V: type) type {
try self.item_put(item.next.?, next);
}
- if (std.mem.eql(K, self.head.first, k)) self.head.first = item.next;
- if (self.head.last == k) self.head.last = item.prev;
+ if (std.meta.eql(self.head.first, k)) self.head.first = item.next;
+ if (std.meta.eql(self.head.last, k)) self.head.last = item.prev;
self.head.len -= 1;
try self.head_update();