fix some compatibility problem on Apple using clang