I obviosly want to replace to use log crate and unify logging inside my program.
Obviosly the problem in va_list type.
As I see there is issue about this, but it is not part of stable yet, is it true?
But there is va_list - Rust , any idea how it works without rust compiler support?
Also there is preformatted argument in registerCallback, with it fmt will contain full string,
and va_list will be NULL. But I can not see it helps me or not.
Is it UB to define va_arg in some compatitable way and just ignore it?
the most portable way would be to write a C stub function that converts the va_list to an array in a format that the Rust FFI understands and calls the rust function
Is it UB to define va_arg in some compatitable way and just ignore it?
ignoring a NULL pointer (as void* for example) would be perfectly safe, however I'm not sure that va_list is typedef'ed to a pointer on every platform, it might be a special structure that requires cleanup even if it contains no arguments.