| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BASE_MAC_MAC_UTIL_H_ | 5 #ifndef BASE_MAC_MAC_UTIL_H_ |
| 6 #define BASE_MAC_MAC_UTIL_H_ | 6 #define BASE_MAC_MAC_UTIL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <AvailabilityMacros.h> | 9 #include <AvailabilityMacros.h> |
| 10 #include <Carbon/Carbon.h> | 10 #include <Carbon/Carbon.h> |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 | 143 |
| 144 // Mountain Lion is Mac OS X 10.8, Darwin 12. | 144 // Mountain Lion is Mac OS X 10.8, Darwin 12. |
| 145 BASE_EXPORT bool IsOSMountainLion(); | 145 BASE_EXPORT bool IsOSMountainLion(); |
| 146 BASE_EXPORT bool IsOSMountainLionOrLater(); | 146 BASE_EXPORT bool IsOSMountainLionOrLater(); |
| 147 | 147 |
| 148 // This should be infrequently used. It only makes sense to use this to avoid | 148 // This should be infrequently used. It only makes sense to use this to avoid |
| 149 // codepaths that are very likely to break on future (unreleased, untested, | 149 // codepaths that are very likely to break on future (unreleased, untested, |
| 150 // unborn) OS releases. | 150 // unborn) OS releases. |
| 151 BASE_EXPORT | 151 BASE_EXPORT |
| 152 bool IsOSDangerouslyLaterThanMountainLionForUseByCFAllocatorReplacement(); | 152 bool IsOSDangerouslyLaterThanMountainLionForUseByCFAllocatorReplacement(); |
| 153 // TODO(rsesek|avi): Remove when allocators gonna allocate. | |
| 154 BASE_EXPORT bool IsOSLaterThanLion(); | |
| 155 | 153 |
| 156 // When the deployment target is set, the code produced cannot run on earlier | 154 // When the deployment target is set, the code produced cannot run on earlier |
| 157 // OS releases. That enables some of the IsOS* family to be implemented as | 155 // OS releases. That enables some of the IsOS* family to be implemented as |
| 158 // constant-value inline functions. The MAC_OS_X_VERSION_MIN_REQUIRED macro | 156 // constant-value inline functions. The MAC_OS_X_VERSION_MIN_REQUIRED macro |
| 159 // contains the value of the deployment target. | 157 // contains the value of the deployment target. |
| 160 | 158 |
| 161 #if defined(MAC_OS_X_VERSION_10_6) && \ | 159 #if defined(MAC_OS_X_VERSION_10_6) && \ |
| 162 MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 | 160 MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 |
| 163 #define BASE_MAC_MAC_UTIL_H_INLINED_GE_10_6 | 161 #define BASE_MAC_MAC_UTIL_H_INLINED_GE_10_6 |
| 164 inline bool IsOSLeopard() { return false; } | 162 inline bool IsOSLeopard() { return false; } |
| 165 inline bool IsOSLeopardOrEarlier() { return false; } | 163 inline bool IsOSLeopardOrEarlier() { return false; } |
| 166 inline bool IsOSSnowLeopardOrLater() { return true; } | 164 inline bool IsOSSnowLeopardOrLater() { return true; } |
| 167 #endif | 165 #endif |
| 168 | 166 |
| 169 #if defined(MAC_OS_X_VERSION_10_7) && \ | 167 #if defined(MAC_OS_X_VERSION_10_7) && \ |
| 170 MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7 | 168 MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7 |
| 171 #define BASE_MAC_MAC_UTIL_H_INLINED_GE_10_7 | 169 #define BASE_MAC_MAC_UTIL_H_INLINED_GE_10_7 |
| 172 inline bool IsOSSnowLeopard() { return false; } | 170 inline bool IsOSSnowLeopard() { return false; } |
| 173 inline bool IsOSSnowLeopardOrEarlier() { return false; } | 171 inline bool IsOSSnowLeopardOrEarlier() { return false; } |
| 174 inline bool IsOSLionOrLater() { return true; } | 172 inline bool IsOSLionOrLater() { return true; } |
| 175 #endif | 173 #endif |
| 176 | 174 |
| 177 #if defined(MAC_OS_X_VERSION_10_7) && \ | 175 #if defined(MAC_OS_X_VERSION_10_7) && \ |
| 178 MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_7 | 176 MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_7 |
| 179 #define BASE_MAC_MAC_UTIL_H_INLINED_GT_10_7 | 177 #define BASE_MAC_MAC_UTIL_H_INLINED_GT_10_7 |
| 180 inline bool IsOSLion() { return false; } | 178 inline bool IsOSLion() { return false; } |
| 181 inline bool IsOSLionOrEarlier() { return false; } | 179 inline bool IsOSLionOrEarlier() { return false; } |
| 182 inline bool IsOSLaterThanLion() { return true; } | |
| 183 #endif | 180 #endif |
| 184 | 181 |
| 185 #if defined(MAC_OS_X_VERSION_10_8) && \ | 182 #if defined(MAC_OS_X_VERSION_10_8) && \ |
| 186 MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8 | 183 MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8 |
| 187 #define BASE_MAC_MAC_UTIL_H_INLINED_GE_10_8 | 184 #define BASE_MAC_MAC_UTIL_H_INLINED_GE_10_8 |
| 188 inline bool IsOSMountainLionOrLater() { return true; } | 185 inline bool IsOSMountainLionOrLater() { return true; } |
| 189 #endif | 186 #endif |
| 190 | 187 |
| 191 #if defined(MAC_OS_X_VERSION_10_8) && \ | 188 #if defined(MAC_OS_X_VERSION_10_8) && \ |
| 192 MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_8 | 189 MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_8 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 207 // If any error occurs, none of the input pointers are touched. | 204 // If any error occurs, none of the input pointers are touched. |
| 208 BASE_EXPORT bool ParseModelIdentifier(const std::string& ident, | 205 BASE_EXPORT bool ParseModelIdentifier(const std::string& ident, |
| 209 std::string* type, | 206 std::string* type, |
| 210 int32* major, | 207 int32* major, |
| 211 int32* minor); | 208 int32* minor); |
| 212 | 209 |
| 213 } // namespace mac | 210 } // namespace mac |
| 214 } // namespace base | 211 } // namespace base |
| 215 | 212 |
| 216 #endif // BASE_MAC_MAC_UTIL_H_ | 213 #endif // BASE_MAC_MAC_UTIL_H_ |
| OLD | NEW |