compile basename and dirname for msvc