Put declarations/definitions of unused variables under corresponding macros to silence clang warnings.
I feel this is pretty tricky to declare a variable unused in a portable way in general. Some compilers don't accept the attribute.
Note also that the variables are actually used in some builds and not used in a other builds (debug/release, Linux/Windows, etc.),
and conditions are different for different variables.