fix build bugs on non-windows