From 96011c005617780cc57834235c4a243e00d6d476 Mon Sep 17 00:00:00 2001 From: Ryan Schmidt Date: Thu, 6 Jan 2022 12:37:33 -0600 Subject: [PATCH 1/2] Include mach_port.h in netcpu_osx.c Fixes build failure: error: implicit declaration of function 'mach_port_deallocate' is invalid in C99 [-Werror,-Wimplicit-function-declaration] --- src/netcpu_osx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/netcpu_osx.c b/src/netcpu_osx.c index 63ab5a2..486b8d6 100644 --- a/src/netcpu_osx.c +++ b/src/netcpu_osx.c @@ -71,7 +71,7 @@ char netcpu_sysctl_id[]="\ SnowLeopard (10.6) happy, we hope it does not anger previous versions */ #include -/* #include */ +#include #include "netsh.h" #include "netlib.h" From 512111ad274a9814542ba686db7baff7b53c6515 Mon Sep 17 00:00:00 2001 From: Ryan Schmidt Date: Thu, 6 Jan 2022 12:52:30 -0600 Subject: [PATCH 2/2] Use both arguments to mach_port_deallocate Fixes build failure: netcpu_osx.c:73:37: error: too few arguments to function call, expected 2, have 1 --- src/netcpu_osx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/netcpu_osx.c b/src/netcpu_osx.c index 486b8d6..4120176 100644 --- a/src/netcpu_osx.c +++ b/src/netcpu_osx.c @@ -93,7 +93,7 @@ cpu_util_init(void) void cpu_util_terminate(void) { - mach_port_deallocate(lib_host_port); + mach_port_deallocate(mach_task_self(), lib_host_port); return; }