Skip to content

Commit 6f7feeb

Browse files
committed
examples(zigcrypto): fix for windows
1 parent 32e2825 commit 6f7feeb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

examples/zigcrypto_test.zig

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const builtin = @import("builtin");
12
const std = @import("std");
23
const debug = std.debug;
34
const mem = std.mem;
@@ -24,8 +25,13 @@ pub fn main() anyerror!void {
2425
}
2526

2627
{
28+
const extension_path = if (builtin.os.tag == .windows)
29+
"./zig-out/bin/zigcrypto.dll"
30+
else
31+
"./zig-out/lib/libzigcrypto";
32+
2733
var pzErrMsg: [*c]u8 = undefined;
28-
const result = sqlite.c.sqlite3_load_extension(db.db, "./zig-out/lib/libzigcrypto", null, &pzErrMsg);
34+
const result = sqlite.c.sqlite3_load_extension(db.db, extension_path, null, &pzErrMsg);
2935
if (result != sqlite.c.SQLITE_OK) {
3036
const err = sqlite.c.sqlite3_errstr(result);
3137
std.debug.panic("unable to load extension, err: {s}, err message: {s}\n", .{ err, std.mem.sliceTo(pzErrMsg, 0) });

0 commit comments

Comments
 (0)