fix the compile errors on Mac
Merge pull request #808 from bitwangyaoyao:2.4_mac