summaryrefslogtreecommitdiffstats
path: root/base/mac/mac_util.h
diff options
context:
space:
mode:
authorrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-14 19:58:22 +0000
committerrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-14 19:58:22 +0000
commitb1e697e81697c8c597470365432c746dbbc5c9c1 (patch)
tree8e1d62650a4acc5856d28dac889b62294ad86a6d /base/mac/mac_util.h
parent81d8f81db11746c21c409bd1a79a53ed680cacec (diff)
downloadchromium_src-b1e697e81697c8c597470365432c746dbbc5c9c1.zip
chromium_src-b1e697e81697c8c597470365432c746dbbc5c9c1.tar.gz
chromium_src-b1e697e81697c8c597470365432c746dbbc5c9c1.tar.bz2
[Mac] Add the OS version check functions for 10.8.
BUG=none TEST=Careful review by Mark. And a unittest. Review URL: http://codereview.chromium.org/9706001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126709 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/mac/mac_util.h')
-rw-r--r--base/mac/mac_util.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/base/mac/mac_util.h b/base/mac/mac_util.h
index 4fefe6c..3d50d61 100644
--- a/base/mac/mac_util.h
+++ b/base/mac/mac_util.h
@@ -138,11 +138,19 @@ BASE_EXPORT bool IsOSSnowLeopardOrLater();
// Lion is Mac OS X 10.7, Darwin 11.
BASE_EXPORT bool IsOSLion();
+BASE_EXPORT bool IsOSLionOrEarlier();
BASE_EXPORT bool IsOSLionOrLater();
+// Mountain Lion is Mac OS X 10.8, Darwin 12.
+BASE_EXPORT bool IsOSMountainLion();
+BASE_EXPORT bool IsOSMountainLionOrLater();
+
// This should be infrequently used. It only makes sense to use this to avoid
// codepaths that are very likely to break on future (unreleased, untested,
// unborn) OS releases.
+BASE_EXPORT
+ bool IsOSDangerouslyLaterThanMountainLionForUseByCFAllocatorReplacement();
+// TODO(rsesek|avi): Remove when allocators gonna allocate.
BASE_EXPORT bool IsOSLaterThanLion();
// When the deployment target is set, the code produced cannot run on earlier
@@ -170,9 +178,26 @@ inline bool IsOSLionOrLater() { return true; }
MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_7
#define BASE_MAC_MAC_UTIL_H_INLINED_GT_10_7
inline bool IsOSLion() { return false; }
+inline bool IsOSLionOrEarlier() { return false; }
inline bool IsOSLaterThanLion() { return true; }
#endif
+#if defined(MAC_OS_X_VERSION_10_8) && \
+ MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
+#define BASE_MAC_MAC_UTIL_H_INLINED_GE_10_8
+inline bool IsOSMountainLionOrLater() { return true; }
+#endif
+
+#if defined(MAC_OS_X_VERSION_10_8) && \
+ MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_8
+#define BASE_MAC_MAC_UTIL_H_INLINED_GT_10_8
+inline bool IsOSMountainLion() { return false; }
+inline bool IsOSDangerouslyLaterThanMountainLionForUseByCFAllocatorReplacement()
+{
+ return true;
+}
+#endif
+
// Retrieve the system's model identifier string from the IOKit registry:
// for example, "MacPro4,1", "MacBookPro6,1". Returns empty string upon
// failure.