Opened 13 years ago
Closed 13 years ago
#8265 closed enhancement (fixed)
memrchr implementation
Reported by: | Barrett | Owned by: | nobody |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | Kits | Version: | R1/Development |
Keywords: | memrchr, libc, glibc | Cc: | |
Blocked By: | Blocking: | ||
Platform: | All |
Description
The memrchr was missing when i tried to compile wget, it's a glibc function...
http://www.delorie.com/gnu/docs/glibc/libc_77.html
so i've written a implementation. I've tested it using the attached test program and all seems ok.
Attachments (3)
Change History (10)
by , 13 years ago
by , 13 years ago
Attachment: | memrchr.diff added |
---|
comment:1 by , 13 years ago
patch: | 0 → 1 |
---|
comment:2 by , 13 years ago
comment:3 by , 13 years ago
I search «memrchr» in public headers, but I can't find it. I found «memrchr» in libroot code so only modifications in posix/string.h are needed.
comment:4 by , 13 years ago
Yeah it should be added with a _GNU_SOURCE guard because memrchr is a GNU extension and only expected by GNU.
by , 13 years ago
Attachment: | memrchr3.diff added |
---|
comment:5 by , 13 years ago
As you can see, other than adding memrchr i've tried to group other gnu extensions like strcasestr and strnlen into the _GNU_SOURCE guard, but this is breaking the build. What should i do then? Leave it as is or go over the broken code and define _GNU_SOURCE where needed?
comment:6 by , 13 years ago
OK, except strnlen is now POSIX. see http://pubs.opengroup.org/onlinepubs/9699919799/functions/strlen.html
comment:7 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Applied in hrev43619 with USE_GNU instead. Thanks!
The function is already present in libroot, but not in string.h. It looks like the current implementation is optimized.