Bug 678423 - Conditionally define 10.7 symbols for 10.6 SDK and lower. r=bgirard
authorSteven Michaud <smichaud@pobox.com>
Fri, 12 Aug 2011 11:48:29 -0500
changeset 74317 5c8b3f1db588e35673ef7c746aad7b00da558318
parent 74316 76505e286fbac352319710ec40f7a9ec22ab461a
child 74318 3e0b5ad76bca5eb18d2a59ae55f9d55e64abfbf9
push id20976
push usersmichaud@pobox.com
push dateFri, 12 Aug 2011 16:49:04 +0000
treeherdermozilla-central@5c8b3f1db588 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgirard
bugs678423
milestone8.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 678423 - Conditionally define 10.7 symbols for 10.6 SDK and lower. r=bgirard
widget/src/cocoa/nsChildView.h
--- a/widget/src/cocoa/nsChildView.h
+++ b/widget/src/cocoa/nsChildView.h
@@ -169,16 +169,25 @@ extern "C" long TSMProcessRawKeyEvent(Ev
 @end
 
 // The following section, required to support fluid swipe tracking on OS X 10.7
 // and up, contains defines/declarations that are only available on 10.7 and up.
 // [NSEvent trackSwipeEventWithOptions:...] also requires that the compiler
 // support "blocks"
 // (http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Blocks/Articles/00_Introduction.html)
 // -- which it does on 10.6 and up (using the 10.6 SDK or higher).
+//
+// MAC_OS_X_VERSION_MAX_ALLOWED "controls which OS functionality, if used,
+// will result in a compiler error because that functionality is not
+// available" (quoting from AvailabilityMacros.h).  The compiler initializes
+// it to the version of the SDK being used.  Its value does *not* prevent the
+// binary from running on higher OS versions.  MAC_OS_X_VERSION_10_7 and
+// friends are defined (in AvailabilityMacros.h) as decimal numbers (not
+// hexadecimal numbers).
+#if !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
 #ifdef __LP64__
 enum {
   NSEventPhaseNone        = 0,
   NSEventPhaseBegan       = 0x1 << 0,
   NSEventPhaseStationary  = 0x1 << 1,
   NSEventPhaseChanged     = 0x1 << 2,
   NSEventPhaseEnded       = 0x1 << 3,
   NSEventPhaseCancelled   = 0x1 << 4,
@@ -205,16 +214,17 @@ typedef NSInteger NSEventGestureAxis;
 - (CGFloat)scrollingDeltaY;
 - (NSEventPhase)phase;
 - (void)trackSwipeEventWithOptions:(NSEventSwipeTrackingOptions)options
           dampenAmountThresholdMin:(CGFloat)minDampenThreshold
                                max:(CGFloat)maxDampenThreshold
                       usingHandler:(void (^)(CGFloat gestureAmount, NSEventPhase phase, BOOL isComplete, BOOL *stop))trackingHandler;
 @end
 #endif // #ifdef __LP64__
+#endif // #if !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
 
 @interface ChildView : NSView<
 #ifdef ACCESSIBILITY
                               mozAccessible,
 #endif
                               mozView, NSTextInput>
 {
 @private