BLD: fix msvc compiler errors

(cherry picked from commit bd36fc4f12dca8739104655e8c176e6ad32873c6)