fix build under osx and windows