fix build fail on osx
Merge pull request #296 from ruil2/build_osx

fix build fail on osx