OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2007 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2007 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 if (printable) { | 66 if (printable) { |
67 ss << '\''; | 67 ss << '\''; |
68 } else { | 68 } else { |
69 ss.str(""); | 69 ss.str(""); |
70 ss << "0x" << std::hex << fc; | 70 ss << "0x" << std::hex << fc; |
71 } | 71 } |
72 out->append(ss.str()); | 72 out->append(ss.str()); |
73 } | 73 } |
74 | 74 |
75 static bool GetOSVersion(int* major, int* minor, int* bugfix) { | 75 static bool GetOSVersion(int* major, int* minor, int* bugfix) { |
76 ASSERT(major && minor && bugfix); | 76 RTC_DCHECK(major && minor && bugfix); |
77 struct utsname uname_info; | 77 struct utsname uname_info; |
78 if (uname(&uname_info) != 0) | 78 if (uname(&uname_info) != 0) |
79 return false; | 79 return false; |
80 | 80 |
81 if (strcmp(uname_info.sysname, "Darwin") != 0) | 81 if (strcmp(uname_info.sysname, "Darwin") != 0) |
82 return false; | 82 return false; |
83 *major = 10; | 83 *major = 10; |
84 | 84 |
85 // The market version of macOS is always 4 lower than the internal version. | 85 // The market version of macOS is always 4 lower than the internal version. |
86 int minor_version = atoi(uname_info.release); | 86 int minor_version = atoi(uname_info.release); |
(...skipping 30 matching lines...) Expand all Loading... |
117 case 7: | 117 case 7: |
118 return kMacOSLion; | 118 return kMacOSLion; |
119 case 8: | 119 case 8: |
120 return kMacOSMountainLion; | 120 return kMacOSMountainLion; |
121 case 9: | 121 case 9: |
122 return kMacOSMavericks; | 122 return kMacOSMavericks; |
123 } | 123 } |
124 return kMacOSNewer; | 124 return kMacOSNewer; |
125 } | 125 } |
126 } // namespace rtc | 126 } // namespace rtc |
OLD | NEW |