fix build under osx and windows
Merge pull request #139 from Chilledheart/develop_darwin

fix build under osx and windows