A number of cases were not handled properly: even though optional userdata was allowed, the handling would cause unreachable to be reached if null handles were actually passed. Also, being able to use void to specify "no userdata please" is useful; however, in this case we do have to still pass NULL to the C library calls. The casting logic has been pulled out to some helper functions, which make it more consistent. Some mediocre additional test coverage has been added as well.
12 lines
335 B
Zig
12 lines
335 B
Zig
// This file is licensed under the CC0 1.0 license.
|
|
// See: https://creativecommons.org/publicdomain/zero/1.0/legalcode
|
|
|
|
comptime {
|
|
if (@import("builtin").is_test) {
|
|
_ = @import("./nats.zig");
|
|
_ = @import("./connection.zig");
|
|
_ = @import("./message.zig");
|
|
_ = @import("./subscription.zig");
|
|
}
|
|
}
|