Fix compiling error on mac os x