OLD | NEW |
1 // Copyright 2015 The Crashpad Authors. All rights reserved. | 1 // Copyright 2015 The Crashpad Authors. All rights reserved. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 17 matching lines...) Expand all Loading... |
28 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 | 28 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 |
29 | 29 |
30 extern "C" { | 30 extern "C" { |
31 | 31 |
32 // proc_get_wakemon_params() is present in the Mac OS X 10.9 SDK, but no | 32 // proc_get_wakemon_params() is present in the Mac OS X 10.9 SDK, but no |
33 // declaration is provided. This provides a declaration and marks it for weak | 33 // declaration is provided. This provides a declaration and marks it for weak |
34 // import if the deployment target is below 10.9. | 34 // import if the deployment target is below 10.9. |
35 int proc_get_wakemon_params(pid_t pid, int* rate_hz, int* flags) | 35 int proc_get_wakemon_params(pid_t pid, int* rate_hz, int* flags) |
36 __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0); | 36 __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0); |
37 | 37 |
| 38 // Redeclare the method without the availability annotation to suppress the |
| 39 // -Wpartial-availability warning. |
| 40 int proc_get_wakemon_params(pid_t pid, int* rate_hz, int* flags); |
| 41 |
38 } // extern "C" | 42 } // extern "C" |
39 | 43 |
40 #else | 44 #else |
41 | 45 |
42 namespace { | 46 namespace { |
43 | 47 |
44 using ProcGetWakemonParamsType = int (*)(pid_t, int*, int*); | 48 using ProcGetWakemonParamsType = int (*)(pid_t, int*, int*); |
45 | 49 |
46 // The SDK doesn’t have proc_get_wakemon_params() to link against, even with | 50 // The SDK doesn’t have proc_get_wakemon_params() to link against, even with |
47 // weak import. This function returns a function pointer to it if it exists at | 51 // weak import. This function returns a function pointer to it if it exists at |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 | 203 |
200 // Treat unknown exceptions as fatal. This is the conservative approach: it | 204 // Treat unknown exceptions as fatal. This is the conservative approach: it |
201 // may result in more crash reports being generated, but the type-flavor | 205 // may result in more crash reports being generated, but the type-flavor |
202 // combinations can be evaluated to determine appropriate handling. | 206 // combinations can be evaluated to determine appropriate handling. |
203 LOG(WARNING) << "unknown resource type " << resource_type << " flavor " | 207 LOG(WARNING) << "unknown resource type " << resource_type << " flavor " |
204 << resource_flavor; | 208 << resource_flavor; |
205 return false; | 209 return false; |
206 } | 210 } |
207 | 211 |
208 } // namespace crashpad | 212 } // namespace crashpad |
OLD | NEW |