Build fixes for Apple platforms