Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Add more compat defs for code compiled for !NetBSD targets.
details: https://anonhg.NetBSD.org/src/rev/33f804768932
branches: trunk
changeset: 810781:33f804768932
user: pooka <pooka%NetBSD.org@localhost>
date: Mon Sep 21 21:50:16 2015 +0000
description:
Add more compat defs for code compiled for !NetBSD targets.
At least GNU Hurd lacks MAXHOSTNAMELEN/MAXPATHLEN/PATH_MAX, so make sure
those have some arbitrary semi-sane values.
from Robert Millan in PR misc/50166, with some modifications from myself
diffstat:
lib/librumpuser/rumpuser_port.h | 14 +++++++++++++-
tools/compat/compat_defs.h | 12 +++++++++++-
usr.bin/make/make.h | 11 ++++++++++-
3 files changed, 34 insertions(+), 3 deletions(-)
diffs (82 lines):
diff -r ac8bad8e2dfa -r 33f804768932 lib/librumpuser/rumpuser_port.h
--- a/lib/librumpuser/rumpuser_port.h Mon Sep 21 15:50:19 2015 +0000
+++ b/lib/librumpuser/rumpuser_port.h Mon Sep 21 21:50:16 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rumpuser_port.h,v 1.45 2015/08/16 11:37:39 pooka Exp $ */
+/* $NetBSD: rumpuser_port.h,v 1.46 2015/09/21 21:50:16 pooka Exp $ */
#ifndef _LIB_LIBRUMPUSER_RUMPUSER_PORT_H_
#define _LIB_LIBRUMPUSER_RUMPUSER_PORT_H_
@@ -314,4 +314,16 @@
#define setprogname(a)
#endif
+/* at least GNU Hurd does not specify various common hardcoded constants */
+#include <limits.h>
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 4096
+#endif
+#ifndef PATH_MAX
+#define PATH_MAX MAXPATHLEN
+#endif
+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN 256
+#endif
+
#endif /* _LIB_LIBRUMPUSER_RUMPUSER_PORT_H_ */
diff -r ac8bad8e2dfa -r 33f804768932 tools/compat/compat_defs.h
--- a/tools/compat/compat_defs.h Mon Sep 21 15:50:19 2015 +0000
+++ b/tools/compat/compat_defs.h Mon Sep 21 21:50:16 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: compat_defs.h,v 1.102 2015/07/26 14:01:53 kamil Exp $ */
+/* $NetBSD: compat_defs.h,v 1.103 2015/09/21 21:50:16 pooka Exp $ */
#ifndef __NETBSD_COMPAT_DEFS_H__
#define __NETBSD_COMPAT_DEFS_H__
@@ -910,6 +910,13 @@
#define LLONG_MIN ((long long)(~LLONG_MAX))
#endif
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 4096
+#endif
+#ifndef PATH_MAX
+#define PATH_MAX MAXPATHLEN
+#endif
+
/* <paths.h> */
/* The host's _PATH_BSHELL might be broken, so override it. */
@@ -1149,6 +1156,9 @@
#ifndef MAXPHYS
#define MAXPHYS (64 * 1024)
#endif
+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN 256
+#endif
/* XXX needed by makefs; this should be done in a better way */
#undef btodb
diff -r ac8bad8e2dfa -r 33f804768932 usr.bin/make/make.h
--- a/usr.bin/make/make.h Mon Sep 21 15:50:19 2015 +0000
+++ b/usr.bin/make/make.h Mon Sep 21 21:50:16 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: make.h,v 1.95 2014/09/07 20:55:34 joerg Exp $ */
+/* $NetBSD: make.h,v 1.96 2015/09/21 21:50:16 pooka Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -503,4 +503,13 @@
#define MAX(a, b) ((a > b) ? a : b)
#endif
+/* At least GNU/Hurd systems lack hardcoded MAXPATHLEN/PATH_MAX */
+#include <limits.h>
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 4096
+#endif
+#ifndef PATH_MAX
+#define PATH_MAX MAXPATHLEN
+#endif
+
#endif /* _MAKE_H_ */
Home |
Main Index |
Thread Index |
Old Index