From 48717a981db51488bc876152f820a13ba0b9665d Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 30 Jun 2008 19:03:59 +0000 Subject: [PATCH] Move rb.c from sys/lib/libkern to common so it can be in both libc and libkern. --- {sys/lib/libkern => common/lib/libc/gen}/rb.c | 30 ++++++++++++++++++- distrib/sets/lists/base/shl.mi | 6 ++-- lib/libc/gen/Makefile.inc | 4 +-- lib/libc/shlib_version | 4 +-- sys/lib/libkern/Makefile | 3 +- 5 files changed, 37 insertions(+), 10 deletions(-) rename {sys/lib/libkern => common/lib/libc/gen}/rb.c (97%) diff --git a/sys/lib/libkern/rb.c b/common/lib/libc/gen/rb.c similarity index 97% rename from sys/lib/libkern/rb.c rename to common/lib/libc/gen/rb.c index 27d5d482d725..6d98db15be0f 100644 --- a/sys/lib/libkern/rb.c +++ b/common/lib/libc/gen/rb.c @@ -1,4 +1,4 @@ -/* $NetBSD: rb.c,v 1.20 2008/06/30 16:36:18 matt Exp $ */ +/* $NetBSD: rb.c,v 1.1 2008/06/30 19:04:00 matt Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -31,6 +31,7 @@ #if !defined(_KERNEL) && !defined(_STANDALONE) #include +#include #include #include #include @@ -42,6 +43,33 @@ #else #include #endif + +#ifdef _LIBC +__weak_alias(rb_tree_init, _rb_tree_init) +__weak_alias(rb_tree_find_node, _rb_tree_find_node) +__weak_alias(rb_tree_find_node_geq, _rb_tree_find_node_geq) +__weak_alias(rb_tree_find_node_leq, _rb_tree_find_node_leq) +__weak_alias(rb_tree_insert_node, _rb_tree_insert_node) +__weak_alias(rb_tree_remove_node, _rb_tree_remove_node) +__weak_alias(rb_tree_iterate, _rb_tree_iterate) +#ifdef RBDEBUG +__weak_alias(rb_tree_check, _rb_tree_check) +__weak_alias(rb_tree_depths, _rb_tree_depths) +#endif + +#define rb_tree_init _rb_tree_init +#define rb_tree_find_node _rb_tree_find_node +#define rb_tree_find_node_geq _rb_tree_find_node_geq +#define rb_tree_find_node_leq _rb_tree_find_node_leq +#define rb_tree_insert_node _rb_tree_insert_node +#define rb_tree_remove_node _rb_tree_remove_node +#define rb_tree_iterate _rb_tree_iterate +#ifdef RBDEBUG +#define rb_tree_check _rb_tree_check +#define rb_tree_depths _rb_tree_depths +#endif +#endif + #ifdef RBTEST #include "rb.h" #else diff --git a/distrib/sets/lists/base/shl.mi b/distrib/sets/lists/base/shl.mi index 85a2bd238fd8..f36dc47e1ded 100644 --- a/distrib/sets/lists/base/shl.mi +++ b/distrib/sets/lists/base/shl.mi @@ -1,4 +1,4 @@ -# $NetBSD: shl.mi,v 1.439 2008/06/25 11:12:01 ad Exp $ +# $NetBSD: shl.mi,v 1.440 2008/06/30 19:04:00 matt Exp $ # # Note: Don't delete entries from here - mark them as "obsolete" instead, # unless otherwise stated below. @@ -13,7 +13,7 @@ # # Note: libtermcap and libtermlib are hardlinked and share the same version. # -./lib/libc.so.12.161 base-sys-shlib +./lib/libc.so.12.162 base-sys-shlib ./lib/libcrypt.so.0.2 base-sys-shlib ./lib/libcrypto.so.4.1 base-crypto-shlib crypto ./lib/libedit.so.2.11 base-sys-shlib @@ -58,7 +58,7 @@ ./usr/lib/libbluetooth.so.3.0 base-sys-shlib ./usr/lib/libbsdmalloc.so.0.0 base-sys-shlib ./usr/lib/libbz2.so.1.1 base-sys-shlib -./usr/lib/libc.so.12.161 base-sys-shlib +./usr/lib/libc.so.12.162 base-sys-shlib ./usr/lib/libcom_err.so.5.0 base-krb5-shlib kerberos ./usr/lib/libcrypt.so.0.2 base-sys-shlib ./usr/lib/libcrypto.so.4.1 base-crypto-shlib crypto diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index e4676f607c2a..68c493f6f849 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.161 2008/06/17 00:10:54 he Exp $ +# $NetBSD: Makefile.inc,v 1.162 2008/06/30 19:04:00 matt Exp $ # from: @(#)Makefile.inc 8.6 (Berkeley) 5/4/95 # gen sources @@ -20,7 +20,7 @@ SRCS+= _errno.c alarm.c alphasort.c arc4random.c assert.c basename.c clock.c \ nice.c nlist.c nlist_aout.c \ nlist_coff.c nlist_ecoff.c nlist_elf32.c nlist_elf64.c opendir.c \ pause.c popen.c psignal.c pthread_atfork.c pwcache.c \ - pw_scan.c raise.c randomid.c readdir.c rewinddir.c \ + pw_scan.c raise.c randomid.c rb.c readdir.c rewinddir.c \ scandir.c seekdir.c setdomainname.c \ sethostname.c setjmperr.c setmode.c setproctitle.c setprogname.c \ shquote.c shquotev.c sighold.c sigignore.c siginterrupt.c \ diff --git a/lib/libc/shlib_version b/lib/libc/shlib_version index 4c621fa287ec..a303d6d38dfc 100644 --- a/lib/libc/shlib_version +++ b/lib/libc/shlib_version @@ -1,4 +1,4 @@ -# $NetBSD: shlib_version,v 1.202 2008/06/25 11:12:01 ad Exp $ +# $NetBSD: shlib_version,v 1.203 2008/06/30 19:04:00 matt Exp $ # Remember to update distrib/sets/lists/base/shl.* when changing # # things we wish to do on next major version bump: @@ -26,4 +26,4 @@ # - remove frexp, ldexp, modf: they belong to libm. # - make sure we can support thread local [on arm don't use r9 for example] major=12 -minor=161 +minor=162 diff --git a/sys/lib/libkern/Makefile b/sys/lib/libkern/Makefile index a3d1e9bc629c..d66debfb3ec0 100644 --- a/sys/lib/libkern/Makefile +++ b/sys/lib/libkern/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.88 2008/06/15 20:34:18 christos Exp $ +# $NetBSD: Makefile,v 1.89 2008/06/30 19:03:59 matt Exp $ LIB= kern NOPIC= # defined @@ -56,7 +56,6 @@ SRCS+= strtoll.c strtoull.c strtoumax.c SRCS+= xlat_mbr_fstype.c SRCS+= rb.c -COPTS.rb.c+= -Wno-missing-field-initializers # Files to clean up CLEANFILES+= lib${LIB}.o lib${LIB}.po