mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-25 09:00:03 +01:00
OpenBSD: explicitely define nitems
nitems is never guaranteed to be defined in sys/params.h as it is meant to be defined within a protected ifdef __KERNEL condition.
This commit is contained in:
parent
a511a706de
commit
f9a6a97470
@ -1681,6 +1681,10 @@ platform_get_argv0 (void)
|
||||
|
||||
cmdline = (char **) realloc (cmdline, len);
|
||||
|
||||
#ifndef nitems
|
||||
#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0]))
|
||||
#endif
|
||||
|
||||
if (sysctl (mib, nitems (mib), cmdline, &len, NULL, 0) == -1)
|
||||
{
|
||||
g_free (cmdline);
|
||||
|
Loading…
x
Reference in New Issue
Block a user