| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2008 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2008 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 |
| 11 #include "webrtc/base/systeminfo.h" | 11 #include "webrtc/base/systeminfo.h" |
| 12 | 12 |
| 13 #if defined(WEBRTC_WIN) | 13 #if defined(WEBRTC_WIN) |
| 14 #include <winsock2.h> | 14 #include <winsock2.h> |
| 15 #include <windows.h> | 15 #include <windows.h> |
| 16 #ifndef EXCLUDE_D3D9 | 16 #ifndef EXCLUDE_D3D9 |
| 17 #include <d3d9.h> | 17 #include <d3d9.h> |
| 18 #endif | 18 #endif |
| 19 #include <intrin.h> // for __cpuid() | 19 #include <intrin.h> // for __cpuid() |
| 20 #elif defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) | 20 #elif defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) |
| 21 #include <ApplicationServices/ApplicationServices.h> | 21 #include <ApplicationServices/ApplicationServices.h> |
| 22 #include <CoreServices/CoreServices.h> | 22 #include <CoreServices/CoreServices.h> |
| 23 #elif defined(WEBRTC_LINUX) | 23 #elif defined(WEBRTC_LINUX) |
| 24 #include <unistd.h> | 24 #include <unistd.h> |
| 25 #endif | 25 #endif |
| 26 #if defined(WEBRTC_MAC) | 26 #if defined(WEBRTC_MAC) |
| 27 #include <sys/sysctl.h> | 27 #include <sys/sysctl.h> |
| 28 #endif | 28 #endif |
| 29 | 29 |
| 30 #include "webrtc/base/basictypes.h" |
| 30 #include "webrtc/base/common.h" | 31 #include "webrtc/base/common.h" |
| 31 #include "webrtc/base/logging.h" | 32 #include "webrtc/base/logging.h" |
| 32 #include "webrtc/base/stringutils.h" | 33 #include "webrtc/base/stringutils.h" |
| 33 | 34 |
| 34 namespace rtc { | 35 namespace rtc { |
| 35 | 36 |
| 36 // See Also: http://msdn.microsoft.com/en-us/library/ms683194(v=vs.85).aspx | 37 // See Also: http://msdn.microsoft.com/en-us/library/ms683194(v=vs.85).aspx |
| 37 #if !defined(WEBRTC_WIN) | 38 #if !defined(WEBRTC_WIN) |
| 38 // TODO(fbarchard): Use gcc 4.4 provided cpuid intrinsic | 39 // TODO(fbarchard): Use gcc 4.4 provided cpuid intrinsic |
| 39 // 32 bit fpic requires ebx be preserved | 40 // 32 bit fpic requires ebx be preserved |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 int error = sysctlbyname("hw.model", buffer, &length, NULL, 0); | 205 int error = sysctlbyname("hw.model", buffer, &length, NULL, 0); |
| 205 if (!error) | 206 if (!error) |
| 206 return std::string(buffer, length - 1); | 207 return std::string(buffer, length - 1); |
| 207 return std::string(); | 208 return std::string(); |
| 208 #else | 209 #else |
| 209 return "Not available"; | 210 return "Not available"; |
| 210 #endif | 211 #endif |
| 211 } | 212 } |
| 212 | 213 |
| 213 } // namespace rtc | 214 } // namespace rtc |
| OLD | NEW |