Say I have the following code which contains a string
const char* fmt = L"%s";
int main()
{
printf(fmt, L"hello");
}
Before I compile, I'd like an event to occur which transforms my source code, such that all strings are wrapped by a function. The final code should be like
const char* fmt = w2mb(L"%s");
int main()
{
printf(fmt, w2mb(L"hello"));
}
Intelisense can identify strings so I know it is possible. How can I go about doing this? I figure it relates to pre-build events.