libiberty, include: add bsearch_r
authorNick Alcock <nick.alcock@oracle.com>
Tue, 23 Jun 2020 16:03:03 +0000 (17:03 +0100)
committerJose E. Marchesi <jose.marchesi@oracle.com>
Tue, 23 Jun 2020 16:39:38 +0000 (18:39 +0200)
commitaec24341d0aac1ca57031d066503c420fb850023
tree4eeb94bd058b421c5708e22f2b53eafc65a3c004
parent855bb998c937d4b1c86a394daea8844fe87eb387
libiberty, include: add bsearch_r

libctf wants a bsearch that takes a void * arg pointer to avoid a
nonportable use of __thread.

bsearch_r is required, not optional, at this point because as far as I
can see this obvious-sounding function is not implemented by anyone's
libc.  We can easily move it to AC_LIBOBJ later if it proves necessary
to do so.

include/
* libiberty.h (bsearch_r): New.
libiberty/
* bsearch_r.c: New file.
* Makefile.in (CFILES): Add bsearch_r.c.
(REQUIRED_OFILES): Add bsearch_r.o.
* functions.texi: Regenerate.
include/libiberty.h
libiberty/Makefile.in
libiberty/bsearch_r.c [new file with mode: 0644]
libiberty/functions.texi