mirror of
https://github.com/Kitware/CMake.git
synced 2026-11-06 13:27:09 +00:00
libuv: Restore support for macOS 10.10
Upstream libuv no longer supports this version.
This commit is contained in:
1 parent
b85b6ded3b
commit
ea45d99691
2 files changed
+19
-2
No files matched your search
@@ -165,6 +165,7 @@ void uv_loadavg(double avg[3]) {
|
||||
|
||||
int uv_resident_set_memory(size_t* rss) {
|
||||
mach_msg_type_number_t count;
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101100
|
||||
task_vm_info_data_t info;
|
||||
kern_return_t err;
|
||||
|
||||
@@ -182,6 +183,22 @@ int uv_resident_set_memory(size_t* rss) {
|
||||
*/
|
||||
assert(err == KERN_SUCCESS);
|
||||
*rss = info.phys_footprint;
|
||||
#else
|
||||
task_basic_info_data_t info;
|
||||
kern_return_t err;
|
||||
|
||||
count = TASK_BASIC_INFO_COUNT;
|
||||
err = task_info(mach_task_self(),
|
||||
TASK_BASIC_INFO,
|
||||
(task_info_t) &info,
|
||||
&count);
|
||||
(void) &err;
|
||||
/* task_info(TASK_BASIC_INFO) cannot really fail. Anything other than
|
||||
* KERN_SUCCESS implies a libuv bug.
|
||||
*/
|
||||
assert(err == KERN_SUCCESS);
|
||||
*rss = info.resident_size;
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
|
||||
}
|
||||
|
||||
if ((w->events & UV__POLLPRI) == 0 && (w->pevents & UV__POLLPRI) != 0) {
|
||||
#ifdef __APPLE__
|
||||
#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 101300
|
||||
/*
|
||||
* Use EVFILT_EXCEPT+ NOTE_OOB for macOS since it defines this flag.
|
||||
* FreeBSD does not.
|
||||
@@ -386,7 +386,7 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
|
||||
revents |= UV__POLLRDHUP;
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 101300
|
||||
/* Match EVFILT_EXCEPT used above for macOS. */
|
||||
if (ev->filter == EVFILT_EXCEPT) {
|
||||
#else
|
||||
|
||||
Reference in new issue
Block a user