]> gitweb.ps.run Git - ziglmdb/commitdiff
update
authorpatrick-scho <patrick.schoenberger@posteo.de>
Fri, 7 Nov 2025 14:13:28 +0000 (15:13 +0100)
committerpatrick-scho <patrick.schoenberger@posteo.de>
Fri, 7 Nov 2025 14:13:28 +0000 (15:13 +0100)
build.zig
build.zig.zon
src/db.zig

index 572a55cc56d9e4f26a9bcc6f433a103898e9eeeb..79d8d8f06a6fcb18bd467aa70228a721e8830d1d 100644 (file)
--- 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);
 }
index cf95235318652d5d674534f2d52fc5a7d4f31fb6..271425e4eb7d9ee5e7fe9605cdf117fc4068125d 100644 (file)
@@ -1,6 +1,7 @@
 .{
-    .name = "lmdb",
+    .name = .lmdb,
     .version = "0.0.0",
+    .fingerprint = 0xb296610351cd9899,
     .paths = .{
         "src/lmdb.zig",
         "src/db.zig",
index 3e1b1863dafe3c0de451db578cd291904b65a774..99d3eb3ead173345d62e4545ab6b335023ae4e04 100644 (file)
@@ -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();