Bug 956310 - DMD builds fail on Mac OS X. r=bgirard
authorSteven Michaud <smichaud@pobox.com>
Wed, 08 Jan 2014 17:06:22 -0600
changeset 162643 8e8e69473e913be3255c58dff42cfeef2a237470
parent 162642 4a3e51bf999b74d532c5edd237d2f3f3a8a7d43c
child 162644 114c763763b0fc5495be053aafef39150b727d3f
push id38257
push usersmichaud@pobox.com
push dateWed, 08 Jan 2014 23:06:54 +0000
treeherdermozilla-inbound@8e8e69473e91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgirard
bugs956310
milestone29.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 956310 - DMD builds fail on Mac OS X. r=bgirard
xpcom/base/nsStackWalk.cpp
--- a/xpcom/base/nsStackWalk.cpp
+++ b/xpcom/base/nsStackWalk.cpp
@@ -61,21 +61,31 @@ stack_callback(void *pc, void *sp, void 
   // following check for gCriticalAddress.mAddr is critical.
   if (gCriticalAddress.mAddr || dladdr(pc, &info) == 0  ||
       info.dli_sname == nullptr || strcmp(info.dli_sname, name) != 0)
     return;
   gCriticalAddress.mAddr = pc;
 }
 
 #ifdef DEBUG
-#include "nsCocoaFeatures.h"
+#define MAC_OS_X_VERSION_10_7_HEX 0x00001070
+
+static int32_t OSXVersion()
+{
+  static int32_t gOSXVersion = 0x0;
+  if (gOSXVersion == 0x0) {
+    OSErr err = ::Gestalt(gestaltSystemVersion, (SInt32*)&gOSXVersion);
+    MOZ_ASSERT(err == noErr);
+  }
+  return gOSXVersion;
+}
 
 static bool OnLionOrLater()
 {
-  return nsCocoaFeatures::OnLionOrLater();
+  return (OSXVersion() >= MAC_OS_X_VERSION_10_7_HEX);
 }
 #endif
 
 static void
 my_malloc_logger(uint32_t type, uintptr_t arg1, uintptr_t arg2, uintptr_t arg3,
                  uintptr_t result, uint32_t num_hot_frames_to_skip)
 {
   static bool once = false;