projects
/
platform
/
upstream
/
glib.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a511a70
)
OpenBSD: explicitely define nitems
author
Antoine Jacoutot
<ajacoutot@gnome.org>
Sun, 8 Jul 2012 17:23:18 +0000
(19:23 +0200)
committer
Antoine Jacoutot
<ajacoutot@gnome.org>
Sun, 8 Jul 2012 17:23:18 +0000
(19:23 +0200)
nitems is never guaranteed to be defined in sys/params.h as it is meant
to be defined within a protected ifdef __KERNEL condition.
glib/goption.c
patch
|
blob
|
history
diff --git
a/glib/goption.c
b/glib/goption.c
index
e405546
..
d34901e
100644
(file)
--- a/
glib/goption.c
+++ b/
glib/goption.c
@@
-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);