fix compile error in mac g++ and clang++ compiler.