Unreviewed, try to fix the Sierra build after r226277.
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Dec 2017 22:53:07 +0000 (22:53 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Dec 2017 22:53:07 +0000 (22:53 +0000)
The macOS 10.12 SDK does not know about NSControlStateValue and some types of NSLevelIndicatorStyles, so these
need to be declared in a separate section in AppKitCompatibilityDeclarations.h (rather than in the < macOS 10.12
SDK #ifdef).

* wtf/mac/AppKitCompatibilityDeclarations.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226279 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WTF/ChangeLog
Source/WTF/wtf/mac/AppKitCompatibilityDeclarations.h

index c341de57b5091eff8bc6fa244b5c47d1b6a147c4..dc412917d80bbb59c106cf2b7ff240739610026e 100644 (file)
@@ -1,3 +1,13 @@
+2017-12-22  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Unreviewed, try to fix the Sierra build after r226277.
+
+        The macOS 10.12 SDK does not know about NSControlStateValue and some types of NSLevelIndicatorStyles, so these
+        need to be declared in a separate section in AppKitCompatibilityDeclarations.h (rather than in the < macOS 10.12
+        SDK #ifdef).
+
+        * wtf/mac/AppKitCompatibilityDeclarations.h:
+
 2017-12-22  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         Fix build failures due to using deprecated AppKit symbols
index 7f8e7d021867b16855b447945c6ad329c7ceb0b4..2615f94452da581928aa0a5b7806cd57d1031029 100644 (file)
 
 #import <Availability.h>
 
-#if __MAC_OS_X_VERSION_MAX_ALLOWED < 101200
-
+#if __MAC_OS_X_VERSION_MAX_ALLOWED < 101300
 #import <AppKit/AppKit.h>
+#endif
+
+#if __MAC_OS_X_VERSION_MAX_ALLOWED < 101200
 
 static const NSAlertStyle NSAlertStyleCritical = NSCriticalAlertStyle;
 static const NSAlertStyle NSAlertStyleInformational = NSInformationalAlertStyle;
 static const NSAlertStyle NSAlertStyleWarning = NSWarningAlertStyle;
 
-typedef NSInteger NSControlStateValue;
-static const NSControlStateValue NSControlStateValueMixed = NSMixedState;
-static const NSControlStateValue NSControlStateValueOff = NSOffState;
-static const NSControlStateValue NSControlStateValueOn = NSOnState;
-
 static const NSBezelStyle NSBezelStyleShadowlessSquare = NSShadowlessSquareBezelStyle;
 static const NSBezelStyle NSBezelStyleRounded = NSRoundedBezelStyle;
 static const NSBezelStyle NSBezelStyleRoundedDisclosure = NSRoundedDisclosureBezelStyle;
 
-static const NSLevelIndicatorStyle NSLevelIndicatorStyleRelevancy = NSRelevancyLevelIndicatorStyle;
-static const NSLevelIndicatorStyle NSLevelIndicatorStyleContinuousCapacity = NSContinuousCapacityLevelIndicatorStyle;
-static const NSLevelIndicatorStyle NSLevelIndicatorStyleDiscreteCapacity = NSDiscreteCapacityLevelIndicatorStyle;
-static const NSLevelIndicatorStyle NSLevelIndicatorStyleRating = NSRatingLevelIndicatorStyle;
-
 static const NSButtonType NSButtonTypeMomentaryLight = NSMomentaryLightButton;
 static const NSButtonType NSButtonTypePushOnPushOff = NSPushOnPushOffButton;
 static const NSButtonType NSButtonTypeToggle = NSToggleButton;
@@ -134,6 +126,20 @@ static const NSWindowStyleMask NSWindowStyleMaskTexturedBackground = NSTexturedB
 static const NSWindowStyleMask NSWindowStyleMaskTitled = NSTitledWindowMask;
 static const NSWindowStyleMask NSWindowStyleMaskUtilityWindow = NSUtilityWindowMask;
 
-#endif
+#endif // __MAC_OS_X_VERSION_MAX_ALLOWED < 101200
+
+#if __MAC_OS_X_VERSION_MAX_ALLOWED < 101300
+
+typedef NSInteger NSControlStateValue;
+static const NSControlStateValue NSControlStateValueMixed = NSMixedState;
+static const NSControlStateValue NSControlStateValueOff = NSOffState;
+static const NSControlStateValue NSControlStateValueOn = NSOnState;
+
+static const NSLevelIndicatorStyle NSLevelIndicatorStyleRelevancy = NSRelevancyLevelIndicatorStyle;
+static const NSLevelIndicatorStyle NSLevelIndicatorStyleContinuousCapacity = NSContinuousCapacityLevelIndicatorStyle;
+static const NSLevelIndicatorStyle NSLevelIndicatorStyleDiscreteCapacity = NSDiscreteCapacityLevelIndicatorStyle;
+static const NSLevelIndicatorStyle NSLevelIndicatorStyleRating = NSRatingLevelIndicatorStyle;
+
+#endif // __MAC_OS_X_VERSION_MAX_ALLOWED < 101300
 
 #endif // AppKitCompatibilityDeclarations_h