Skip to content

Commit bc196de

Browse files
Jonathan D.A. Jewellclaude
andcommitted
fix(ffi): remove C header requirement from Zig build
- Remove mandatory installFile for include/proven.h - Fix unused parameter error in proven_header_build_csp - The Zig FFI exposes C ABI but doesn't require C headers - Modern consumers (Zig, Rust via zig-cc) work without headers Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 2712390 commit bc196de

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

ffi/zig/build.zig

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,11 @@ pub fn build(b: *std.Build) void {
112112
all_wasm_step.dependOn(wasm_browser_step);
113113
all_wasm_step.dependOn(wasm_wasi_step);
114114

115-
// Header file installation
116-
b.installFile("include/proven.h", "include/proven.h");
115+
// Header file installation (optional - for C/C++ consumers only)
116+
// The Zig library exposes a C ABI, but consumers using Zig, Rust (via zig-cc),
117+
// or other modern FFI mechanisms don't need a header file.
118+
// Uncomment if you need C header for legacy interop:
119+
// b.installFile("include/proven.h", "include/proven.h");
117120

118121
// Tests
119122
const main_tests = b.addTest(.{

ffi/zig/src/main.zig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,8 @@ export fn proven_header_render(
922922
}
923923

924924
/// Build Content-Security-Policy header value from directives
925-
export fn proven_header_build_csp(directives_json: ?[*]const u8, json_len: usize) StringResult {
925+
export fn proven_header_build_csp(directives_json: ?[*]const u8, _json_len: usize) StringResult {
926+
_ = _json_len; // Will be used when JSON parsing is implemented
926927
if (directives_json == null) {
927928
return .{ .status = .err_null_pointer, .value = null, .length = 0 };
928929
}

0 commit comments

Comments
 (0)