Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Sep 2012 16:23:23 +0000 (UTC)
From:      Brooks Davis <brooks@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r240658 - in projects/mtree: include lib/libc/gen
Message-ID:  <201209181623.q8IGNNbK023964@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: brooks
Date: Tue Sep 18 16:23:23 2012
New Revision: 240658
URL: http://svn.freebsd.org/changeset/base/240658

Log:
  Work around the lack of some NetBSD macros from sys/cdefs.h.

Modified:
  projects/mtree/include/vis.h
  projects/mtree/lib/libc/gen/unvis.c
  projects/mtree/lib/libc/gen/vis.c

Modified: projects/mtree/include/vis.h
==============================================================================
--- projects/mtree/include/vis.h	Tue Sep 18 16:01:25 2012	(r240657)
+++ projects/mtree/include/vis.h	Tue Sep 18 16:23:23 2012	(r240658)
@@ -105,7 +105,7 @@ int	strunvisx(char *, const char *, int)
 int	strnunvisx(char *, size_t, const char *, int);
 
 #ifndef __LIBC12_SOURCE__
-int	unvis(char *, int, int *, int) __RENAME(__unvis50);
+int	unvis(char *, int, int *, int);
 #endif
 __END_DECLS
 

Modified: projects/mtree/lib/libc/gen/unvis.c
==============================================================================
--- projects/mtree/lib/libc/gen/unvis.c	Tue Sep 18 16:01:25 2012	(r240657)
+++ projects/mtree/lib/libc/gen/unvis.c	Tue Sep 18 16:23:23 2012	(r240658)
@@ -48,6 +48,14 @@ __RCSID("$NetBSD: unvis.c,v 1.39 2012/03
 #include <errno.h>
 #include <vis.h>
 
+#define	_DIAGASSERT(x)	assert(x)
+
+/*
+ * Return the number of elements in a statically-allocated array,
+ * __x.
+ */
+#define	__arraycount(__x)	(sizeof(__x) / sizeof(__x[0]))
+
 #ifdef __weak_alias
 __weak_alias(strnunvisx,_strnunvisx)
 #endif

Modified: projects/mtree/lib/libc/gen/vis.c
==============================================================================
--- projects/mtree/lib/libc/gen/vis.c	Tue Sep 18 16:01:25 2012	(r240657)
+++ projects/mtree/lib/libc/gen/vis.c	Tue Sep 18 16:23:23 2012	(r240658)
@@ -78,6 +78,8 @@ __weak_alias(strvisx,_strvisx)
 #include <stdio.h>
 #include <string.h>
 
+#define _DIAGASSERT(x)  assert(x)
+
 static char *do_svis(char *, size_t *, int, int, int, const char *);
 
 #undef BELL



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201209181623.q8IGNNbK023964>