diff options
author | Benjamin Barenblat <bbaren@google.com> | 2018-11-07 15:10:40 -0500 |
---|---|---|
committer | Benjamin Barenblat <bbaren@google.com> | 2018-11-07 15:10:40 -0500 |
commit | 765c39bea005eaa49852ac1f877ed042ab5b68e6 (patch) | |
tree | cd73d7eea5432f111d04a4d182c839bf1a8c01c4 /tests/url.ur | |
parent | 096fbda34b67cccd2026c44006bd9bc98d28c98c (diff) |
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 'tests/url.ur')
0 files changed, 0 insertions, 0 deletions