OSDN Git Service
(root)
/
android-x86
/
external-bluetooth-glib.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f6b98fe
)
OpenBSD: explicitely define nitems
author
Antoine Jacoutot
<ajacoutot@gnome.org>
Sun, 8 Jul 2012 17:23:18 +0000
(19:23 +0200)
committer
Matthias Clasen
<mclasen@redhat.com>
Sat, 14 Jul 2012 20:33:22 +0000
(16:33 -0400)
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
3da6bfb
..
2fb42e1
100644
(file)
--- a/
glib/goption.c
+++ b/
glib/goption.c
@@
-1680,6
+1680,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);