fix some compiling errors on iOS
Merge pull request #4126 from minggo/master

[ci skip]fix some compiling errors on iOS