Use @available to protect a reference to CIDetectorTypeQRCode.
An upcoming version of clang removes the ability to suppress availability warnings by redeclaring functions. The new way to suppress warnings is to either annotate the caller with an availability attribute or enclose the function reference in an "if (@available)" block. This patch does the latter for a reference to CIDetectorTypeQRCode (which requires 10.10) in the constructor for BarcodeDetectionImplMac. A test relies on being able to construct this object even on pre-10.10 systems, so we cannot use the availability attribute or assert that we are 10.10 or higher. Bug: 735328 Change-Id: I64883a34911b95e624b6ccb0f638034920aef75d Reviewed-on: https://chromium-review.googlesource.com/565028 Commit-Queue: Miguel Casas <mcasas@chromium.org> Reviewed-by:Miguel Casas <mcasas@chromium.org> Cr-Commit-Position: refs/heads/master@{#485484}
Showing
Please register or sign in to comment