OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 VersionUtilMac_h | 5 #ifndef VersionUtilMac_h |
6 #define VersionUtilMac_h | 6 #define VersionUtilMac_h |
7 | 7 |
8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
9 | 9 |
| 10 #include <AvailabilityMacros.h> |
| 11 |
10 namespace blink { | 12 namespace blink { |
11 | 13 |
12 // Mavericks is Mac OS X 10.9, Darwin 13. | 14 namespace internal { |
13 PLATFORM_EXPORT bool IsOSMavericks(); | |
14 | 15 |
15 // Yosemite is Mac OS X 10.10, Darwin 14. | 16 PLATFORM_EXPORT int MacOSXMinorVersion(); |
16 PLATFORM_EXPORT bool IsOSYosemite(); | |
17 | 17 |
18 // El Capitan is Mac OS X 10.11, Darwin 15. | 18 template <int V, int ID> |
19 PLATFORM_EXPORT bool IsOSElCapitan(); | 19 constexpr bool IsOS() |
| 20 { |
| 21 return MAC_OS_X_VERSION_MIN_REQUIRED <= ID && MacOSXMinorVersion() == V; |
| 22 } |
| 23 |
| 24 } // namespace internal |
| 25 |
| 26 const auto IsOS10_9 = internal::IsOS<9, 1090>; |
| 27 const auto IsOS10_10 = internal::IsOS<10, 101000>; |
| 28 const auto IsOS10_11 = internal::IsOS<11, 101100>; |
| 29 const auto IsOS10_12 = internal::IsOS<12, 101200>; |
20 | 30 |
21 } // namespace blink | 31 } // namespace blink |
22 | 32 |
23 #endif // VersionUtilMac_h | 33 #endif // VersionUtilMac_h |
OLD | NEW |