3 ms·
> And last time I tried it wasn't even possible to interface with a varargs function. Calling varargs functions over FFI has been possible since before Rust 1.
by steveklabnik 2y ago
> And last time I tried it wasn't even possible to interface with a varargs function.
Calling varargs functions over FFI has been possible since before Rust 1.0, here's printf, for example https://docs.rs/libc/latest/libc/fn.printf.html https://docs.rs/libc/latest/libc/fn.printf.html
- petabyt 2y agoBut you would have to manually pass cstrings into it? Is there a way to make a wrapper to pass rust strings into it? Now that I think about it that may have been my issue.
- steveklabnik 2y agoCorrect, Rust and C strings are different, so you have to do some sort of conversion between the two, if you have a String and want to pass a *const c_char.