fix compilation on macos/windows