2024-04-24 17:41:47 -07:00
|
|
|
const std = @import("std");
|
|
|
|
|
const testing = std.testing;
|
|
|
|
|
|
|
|
|
|
pub extern "c" fn printf(format: [*:0]const u8, ...) c_int;
|
|
|
|
|
|
|
|
|
|
test "variadic function" {
|
|
|
|
|
try testing.expect(printf("Hello, world!\n") == 14);
|
2024-08-28 02:35:53 +01:00
|
|
|
try testing.expect(@typeInfo(@TypeOf(printf)).@"fn".is_var_args);
|
2024-04-24 17:41:47 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// test
|
|
|
|
|
// link_libc
|
|
|
|
|
// verbose_cimport
|