fix compiler error on macos