$NetBSD: patch-base_posix_sysctl.cc,v 1.7 2025/09/12 16:02:19 kikadf Exp $ * Part of patchset to build chromium on NetBSD * Based on OpenBSD's chromium patches, and pkgsrc's qt5-qtwebengine patches --- base/posix/sysctl.cc.orig 2025-09-08 23:21:33.000000000 +0000 +++ base/posix/sysctl.cc @@ -4,6 +4,7 @@ #include "base/posix/sysctl.h" +#include #include #include @@ -16,17 +17,17 @@ #include "build/build_config.h" namespace { - +// NetBSD has sysctl_func macro in sys/sysctl.h, workaround: sysctl_func -> sysctl_func2 std::optional StringSysctlImpl( - base::FunctionRef sysctl_func) { + base::FunctionRef sysctl_func2) { size_t buf_len; - int result = sysctl_func(nullptr, &buf_len); + int result = sysctl_func2(nullptr, &buf_len); if (result < 0 || buf_len < 1) { return std::nullopt; } std::string value(buf_len - 1, '\0'); - result = sysctl_func(&value[0], &buf_len); + result = sysctl_func2(&value[0], &buf_len); if (result < 0) { return std::nullopt; }