The MSVC specific pragmas disable this warning, but the pragmas themselves (when not guarded by any _MSC_VER ifdef) cause warnings for other targets, e.g. when targeting mingw.
Instead silence the MSVC warnings about unused parameters by casting the parameters to void.
I also noticed that we have a similar case elsewhere already in the same file, which uses #if defined(_MSC_VER) && !defined(__clang__).