patched for xcode 6.1