From 8936dbe367298fc2fb0065a74bc034e3d842e708 Mon Sep 17 00:00:00 2001 From: Alexandre Perrin Date: Thu, 21 Nov 2013 17:45:24 +0100 Subject: [PATCH 5/7] bmake: local modifications in order to make it compile successfully. The main.c diff reveal that our sysctl(3) take an `int *' as argument where bmake expect it to be `const int *'. After a quick check both NetBSD and FreeBSD use `const int *'. --- contrib/bmake/main.c | 2 +- contrib/bmake/var.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/bmake/main.c b/contrib/bmake/main.c index 7c1e64d..fb35601 100644 --- a/contrib/bmake/main.c +++ b/contrib/bmake/main.c @@ -922,7 +922,7 @@ main(int argc, char **argv) const int mib[2] = { CTL_HW, HW_MACHINE_ARCH }; size_t len = sizeof(machine_arch_buf); - if (sysctl(mib, __arraycount(mib), machine_arch_buf, + if (sysctl(__DECONST(int *, mib) /* XXX */, __arraycount(mib), machine_arch_buf, &len, NULL, 0) < 0) { (void)fprintf(stderr, "%s: sysctl failed (%s).\n", progname, strerror(errno)); diff --git a/contrib/bmake/var.c b/contrib/bmake/var.c index 290ad3a..fa8b515 100644 --- a/contrib/bmake/var.c +++ b/contrib/bmake/var.c @@ -543,7 +543,7 @@ Var_Delete(const char *name, GNode *ctxt) if (strchr(name, '$')) { cp = Var_Subst(NULL, name, VAR_GLOBAL, 0); } else { - cp = (char *)name; + cp = __DECONST(char *,name); /* XXX */ } ln = Hash_FindEntry(&ctxt->context, cp); if (DEBUG(VAR)) { -- 1.8.4.1