I am porting a win32 app to linux and instead of having bunch of #ifdefs around every _snprintf_s, I was wondering if there is a way to #define it to snprintf somehow.
So something like -
#define _snprintf_s(1,2,3,4,5) snprintf(1,2,4,5)
The third parameter, Maximum number of characters to store, or _TRUNCATE is not present for snprintf.
Is this approach right? Can I do such a #define? If so, can someone maybe point out how I should go about it?
I went through this question to know I have to be careful about such #defines.
Thanks!
#define _snprintf_s(a,b,c,...) snprintf(a,b,__VA_ARGS__)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With