Add availability attributes to NSView function redeclarations.

An upcoming version of clang removes the ability to suppress
availability warnings by redeclaring functions. This means that the
references to the types NSPressureConfiguration, NSLayoutXAxisAnchor,
NSLayoutYAxisAnchor and NSLayoutDimension in our redeclarations will
cause fatal warnings when compiling with a 10.12 SDK and targeting
10.9 because these types are marked as unavailable in 10.9.

To avoid this, add availability attributes to the functions that
reference these types. According to Apple's documentation, the function
NSView::setPressureConfiguration was added in 10.11, not 10.10.3,
so move its declaration to the 10.11 block.

Because we have updated the availability for the functions that we
have redeclared, we must now switch to the new method for suppressing
availability warnings for references to those functions, which is to
either annotate the caller with an availability attribute, or enclose
the function reference in an "if (@available)" block. This patch
does so for all references to the functions that we have redeclared,
as well as for two enumerator references which the new compiler will
complain about.

Bug: 735328
Change-Id: I5b447932d57cc9459a05a75050f4212892b66714
Reviewed-on: https://chromium-review.googlesource.com/564224
Commit-Queue: Peter Collingbourne <[email protected]>
Reviewed-by: Mark Mentovai <[email protected]>
Cr-Commit-Position: refs/heads/master@{#485781}
4 files changed