Issue #5981: Fix iOS compilation issues