From e55735b613afe7af55a4e25fa92aadf9fb804294 Mon Sep 17 00:00:00 2001 From: infirit Date: Fri, 19 Dec 2014 01:08:47 +0100 Subject: OpenBSD: use G_N_ELEMENTS instead of nitems nitems is never guaranteed to be defined in sys/params.h as it is meant to be defined within a protected ifdef __KERNEL conditional. Use G_N_ELEMENTS from GLib which is the proper way of doing this. Taken from GSM commit: a9972b6a45b490fd316a1a536115baca465e3ae6 From: Antoine Jacoutot --- src/procproperties.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/procproperties.cpp b/src/procproperties.cpp index b378dc6..b8af0d1 100644 --- a/src/procproperties.cpp +++ b/src/procproperties.cpp @@ -120,7 +120,7 @@ fill_proc_properties (GtkWidget *tree, ProcInfo *info) int HZ; int mib[] = { CTL_KERN, KERN_CLOCKRATE }; - if (sysctl (mib, nitems(mib), &cinf, &size, NULL, 0) == -1) + if (sysctl (mib, G_N_ELEMENTS (mib), &cinf, &size, NULL, 0) == -1) HZ = 100; else HZ = cinf.hz; -- cgit v1.2.1