fix compile errors on mac os x when using clang