You are not just replacing the function's implementation but also it's signature. Any macro declaring the extra variable will surely lead to errors because you cannot declare variables at every site where you can call functions.
The best way is to use your editor's find and replace function, fixing this case-by-case.