Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Add cdbr(3) support to tools/compat.



details:   https://anonhg.NetBSD.org/src/rev/20d1f36ef6d7
branches:  trunk
changeset: 779588:20d1f36ef6d7
user:      joerg <joerg%NetBSD.org@localhost>
date:      Mon Jun 04 19:06:45 2012 +0000

description:
Add cdbr(3) support to tools/compat.

diffstat:

 lib/libc/cdb/cdbr.c   |  14 ++++++++++++--
 tools/compat/Makefile |   4 ++--
 tools/compat/cdbr.h   |   5 +++++
 3 files changed, 19 insertions(+), 4 deletions(-)

diffs (63 lines):

diff -r 9ee54e49111b -r 20d1f36ef6d7 lib/libc/cdb/cdbr.c
--- a/lib/libc/cdb/cdbr.c       Mon Jun 04 18:53:02 2012 +0000
+++ b/lib/libc/cdb/cdbr.c       Mon Jun 04 19:06:45 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cdbr.c,v 1.2 2010/06/03 12:40:52 veego Exp $   */
+/*     $NetBSD: cdbr.c,v 1.3 2012/06/04 19:06:45 joerg Exp $   */
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -36,12 +36,17 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: cdbr.c,v 1.2 2010/06/03 12:40:52 veego Exp $");
+__RCSID("$NetBSD: cdbr.c,v 1.3 2012/06/04 19:06:45 joerg Exp $");
 
 #include "namespace.h"
 
+#if !HAVE_NBTOOL_CONFIG_H
 #include <sys/bitops.h>
+#endif
+#if !HAVE_NBTOOL_CONFIG_H || HAVE_SYS_ENDIAN_H
 #include <sys/endian.h>
+#endif
+
 #include <sys/mman.h>
 #include <sys/stat.h>
 #include <cdbr.h>
@@ -59,6 +64,11 @@
 __weak_alias(cdbr_open,_cdbr_open)
 #endif
 
+#if HAVE_NBTOOL_CONFIG_H
+#define        fast_divide32_prepare(d,m,s1,s2)        (void)0
+#define        fast_remainder32(v,d,m,s1,s2)           (v%d)
+#endif
+
 struct cdbr {
        uint8_t *mmap_base;
        size_t mmap_size;
diff -r 9ee54e49111b -r 20d1f36ef6d7 tools/compat/Makefile
--- a/tools/compat/Makefile     Mon Jun 04 18:53:02 2012 +0000
+++ b/tools/compat/Makefile     Mon Jun 04 19:06:45 2012 +0000
@@ -1,8 +1,8 @@
-#      $NetBSD: Makefile,v 1.58 2012/06/04 18:53:02 joerg Exp $
+#      $NetBSD: Makefile,v 1.59 2012/06/04 19:06:45 joerg Exp $
 
 HOSTLIB=       nbcompat
 
-SRCS=          atoll.c basename.c cdbw.c dirname.c \
+SRCS=          atoll.c basename.c cdbr.c cdbw.c dirname.c \
                fgetln.c flock.c fparseln.c fpurge.c \
                getcap.c getline.c getmode.c getopt_long.c gettemp.c \
                heapsort.c \
diff -r 9ee54e49111b -r 20d1f36ef6d7 tools/compat/cdbr.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/compat/cdbr.h       Mon Jun 04 19:06:45 2012 +0000
@@ -0,0 +1,5 @@
+/*     $NetBSD: cdbr.h,v 1.1 2012/06/04 19:06:45 joerg Exp $   */
+
+/* We unconditionally use the NetBSD cdbr(3) in libnbcompat. */
+#include "nbtool_config.h"
+#include "../../include/cdbr.h"



Home | Main Index | Thread Index | Old Index