File tree Expand file tree Collapse file tree 2 files changed +16
-20
lines changed
Expand file tree Collapse file tree 2 files changed +16
-20
lines changed Original file line number Diff line number Diff line change @@ -38,17 +38,15 @@ const sync_bit = @import("sync_bit.zig");
3838const site_identity = @import ("site_identity.zig" );
3939const stmt_cache = @import ("stmt_cache.zig" );
4040
41- // Platform-aware logging: use std.log on native, no-op on WASM/freestanding
42- const log = if (builtin .os .tag == .freestanding or builtin .cpu .arch == .wasm32 or builtin .cpu .arch == .wasm64 )
43- struct {
44- // No-op logger for WASM/freestanding
45- pub fn debug (comptime fmt : []const u8 , args : anytype ) void {
46- _ = fmt ;
47- _ = args ;
48- }
41+ // Logging disabled: std.log uses std.io.getStdErr() which crashes when called from
42+ // a dynamically loaded shared library on Linux. The Zig runtime isn't properly
43+ // initialized in that context, causing segfaults.
44+ const log = struct {
45+ pub fn debug (comptime fmt : []const u8 , args : anytype ) void {
46+ _ = fmt ;
47+ _ = args ;
4948 }
50- else
51- std .log .scoped (.changes_vtab );
49+ };
5250
5351// Type conversion between vtab's opaque types and api's opaque types.
5452// Both represent the same underlying SQLite types, just declared separately.
Original file line number Diff line number Diff line change 6969const std = @import ("std" );
7070const builtin = @import ("builtin" );
7171
72- // Platform-aware logging: use std.log on native, no-op on WASM/freestanding
73- const log = if (builtin .os .tag == .freestanding or builtin .cpu .arch == .wasm32 or builtin .cpu .arch == .wasm64 )
74- struct {
75- // No-op logger for WASM/freestanding
76- pub fn debug (comptime fmt : []const u8 , args : anytype ) void {
77- _ = fmt ;
78- _ = args ;
79- }
72+ // Logging disabled: std.log uses std.io.getStdErr() which crashes when called from
73+ // a dynamically loaded shared library on Linux. The Zig runtime isn't properly
74+ // initialized in that context, causing segfaults.
75+ const log = struct {
76+ pub fn debug (comptime fmt : []const u8 , args : anytype ) void {
77+ _ = fmt ;
78+ _ = args ;
8079 }
81- else
82- std .log .scoped (.vtab );
80+ };
8381
8482// =============================================================================
8583// SQLite C ABI Type Definitions
You can’t perform that action at this time.
0 commit comments