fix compilation error on macos