aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbaren@google.com>2018-11-07 15:10:40 -0500
committerGravatar Benjamin Barenblat <bbaren@google.com>2018-11-07 15:10:40 -0500
commit765c39bea005eaa49852ac1f877ed042ab5b68e6 (patch)
treecd73d7eea5432f111d04a4d182c839bf1a8c01c4 /lib
parent096fbda34b67cccd2026c44006bd9bc98d28c98c (diff)
Use our own memmem only when libc doesn’t have oneHEADmaster
Systems without memmem(3) are getting rarer every day. We can improve clarity and efficiency by relying on libc’s memmem whenever possible. Detect at compile time whether the system supports memmem(3); if it does, simply reexport its prototype through memmem.h and emit no code. If it doesn’t, actually build in the memmem code in memmem.c. Along the way, undo the renaming from commit 6dad7c645d8fdb7b7237c89ff7b34e90adbb86b1. Since we’re only creating a memmem prototype if libc doesn’t define the symbol, our prototype should never clash with libc’s. As before, authors should not assume string.h provides a prototype for memmem; they should `#include "memmem.h"` if they use the function.
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions