I'm working on progressively migrating an existing code base from C to Rust. This code base is multi-platform and needs to build on Windows too.
In C code, there were some #define snprintf _snprintf for windows.
In Rust code, when translating a snprintf using libc, it works fine on Linux but it doesn't build on Windows:
12 | use libc::{c_char, c_int, c_void, fprintf, free, malloc, memcpy, size_t, snprintf, sscanf, strcmp, strlen, isprint};
| ^^^^^^^^ ^^^^^^ no `sscanf` in the root
| |
| no `snprintf` in the root
| help: a similar name exists in the module: `printf`
Would it be possible to make sprintf, snprintf and sscanf available on Windows?
I'm working on progressively migrating an existing code base from C to Rust. This code base is multi-platform and needs to build on Windows too.
In C code, there were some
#define snprintf _snprintffor windows.In Rust code, when translating a
snprintfusing libc, it works fine on Linux but it doesn't build on Windows:Would it be possible to make
sprintf,snprintfandsscanfavailable on Windows?