Bug 929686 - Stopgap patch to allow building of CoreLocation stuff with 10.9 SDK. r=spohl
authorSteven Michaud <smichaud@pobox.com>
Thu, 24 Oct 2013 21:10:10 -0500
changeset 166818 d5fa4120ce92b63bfd589b54b57181c99d34fbd6
parent 166817 578c80c21547cdaab10b80426246dca7e18d0b68
child 166819 31e679e3e4d7d847247cc57c6e3e00d75a9288ca
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersspohl
bugs929686
milestone27.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 929686 - Stopgap patch to allow building of CoreLocation stuff with 10.9 SDK. r=spohl
dom/system/mac/CoreLocationLocationProvider.mm
--- a/dom/system/mac/CoreLocationLocationProvider.mm
+++ b/dom/system/mac/CoreLocationLocationProvider.mm
@@ -5,16 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsCOMPtr.h"
 #include "nsGeoPosition.h"
 #include "nsIConsoleService.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIDOMGeoPositionError.h"
 #include "CoreLocationLocationProvider.h"
+#include "nsCocoaFeatures.h"
 #include "prtime.h"
 
 #include <CoreLocation/CLError.h>
 #include <CoreLocation/CLLocation.h>
 #include <CoreLocation/CLLocationManager.h>
 #include <CoreLocation/CLLocationManagerDelegate.h>
 
 #include <objc/objc.h>
@@ -129,16 +130,22 @@ NS_IMPL_ISUPPORTS1(CoreLocationLocationP
 CoreLocationLocationProvider::CoreLocationLocationProvider()
   : mCLObjects(nullptr)
 {
 }
 
 bool
 CoreLocationLocationProvider::IsCoreLocationAvailable()
 {
+#if !defined(MAC_OS_X_VERSION_10_9) || \
+    MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9
+  if (nsCocoaFeatures::OnMavericksOrLater()) {
+    return false;
+  }
+
   NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
 
   @try {
     NSBundle * bundle = [[[NSBundle alloc] initWithPath:@"/System/Library/Frameworks/CoreWLAN.framework"] autorelease];
     if (!bundle) {
       [pool release];
       return false;
     }
@@ -152,16 +159,17 @@ CoreLocationLocationProvider::IsCoreLoca
     if ([[[CWI_class interface] interfaceState] intValue] == kCWInterfaceStateRunning) {
       [pool release];
       return true;
     }
   }
   @catch(NSException *e) {
   }
   [pool release];
+#endif
   return false;
 }
 
 NS_IMETHODIMP
 CoreLocationLocationProvider::Startup()
 {
   if (!mCLObjects) {
     nsAutoPtr<CoreLocationObjects> clObjs(new CoreLocationObjects());