don't rely on param.h for nitems(), ok ajacoutot@
This commit is contained in:
parent
f5e3aee4f3
commit
ddc61472cb
13
devel/glib2/patches/patch-glib_goption_c
Normal file
13
devel/glib2/patches/patch-glib_goption_c
Normal file
@ -0,0 +1,13 @@
|
||||
$OpenBSD: patch-glib_goption_c,v 1.3 2012/07/08 17:09:18 sthen Exp $
|
||||
--- glib/goption.c.orig Sun Jul 8 08:40:22 2012
|
||||
+++ glib/goption.c Sun Jul 8 08:40:24 2012
|
||||
@@ -1680,6 +1680,9 @@ 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);
|
13
x11/gtk+3/patches/patch-gtk_gtkmountoperation-x11_c
Normal file
13
x11/gtk+3/patches/patch-gtk_gtkmountoperation-x11_c
Normal file
@ -0,0 +1,13 @@
|
||||
$OpenBSD: patch-gtk_gtkmountoperation-x11_c,v 1.7 2012/07/08 17:09:17 sthen Exp $
|
||||
--- gtk/gtkmountoperation-x11.c.orig Sun Jul 8 09:40:51 2012
|
||||
+++ gtk/gtkmountoperation-x11.c Sun Jul 8 09:42:51 2012
|
||||
@@ -731,6 +731,9 @@ pid_get_parent (GPid pid)
|
||||
int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, pid,
|
||||
sizeof(struct kinfo_proc), 0 };
|
||||
|
||||
+#ifndef nitems
|
||||
+#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0]))
|
||||
+#endif
|
||||
if (sysctl(mib, nitems(mib), NULL, &len, NULL, 0) == -1)
|
||||
return (-1);
|
||||
mib[5] = (len / sizeof(struct kinfo_proc));
|
Loading…
Reference in New Issue
Block a user