Fork 0

clean up build a bit

Motiejus Jakštys 2022-03-20 08:46:17 +01:00 committed by Motiejus Jakštys
parent b220dd92e3
commit 886382d900
2 changed files with 3 additions and 14 deletions

View File

@ -19,39 +19,28 @@ pub fn build(b: *zbs.Builder) void {
cmph.force_pic = true;
}, &.{

View File

@ -24,7 +24,7 @@ extern fn cmph_io_vector_adapter_destroy(key_source: [*]u8) void;
extern fn cmph_config_new(key_source: [*]const u8) ?[*]u8;
extern fn cmph_config_set_algo(mph: [*]u8, algo: c_int) void;
extern fn cmph_config_set_b(mph: [*]u8, b: c_int) void;
extern fn cmph_new(config: [*]const u8) ?[*]const u8;
extern fn cmph_new(config: [*]const u8) ?[*]u8;
extern fn cmph_config_destroy(mph: [*]u8) void;
extern fn cmph_packed_size(mphf: [*]const u8) u32;
extern fn cmph_pack(mphf: [*]const u8, packed_mphf: [*]u8) void;
@ -33,7 +33,7 @@ extern fn cmph_destroy(mphf: [*]const u8) void;
// pack packs cmph hashes for the given input and returns a slice ("cmph pack
// minus first 4 bytes") for further storage. The slice must be freed by the
// caller.
pub const Error = Allocator.Error || error{Overflow};
pub const Error = error{ OutOfMemory, Overflow };
pub fn pack(allocator: Allocator, input: [][*:0]const u8) Error![]const u8 {
const input_len = try math.cast(c_uint, input.len);
var source = cmph_io_vector_adapter(input.ptr, input_len);
@ -161,7 +161,7 @@ test "pack str" {
try testing.expectEqual(i, hash);
test "CMPH_ALGO is in sync" {
test "CMPH_ALGO.CMPH_BDZ is in sync with our definition" {
const c = @cImport({