Line | |
---|
1 | #include <sys/types.h> |
---|
2 | #include <string.h> |
---|
3 | |
---|
4 | /* gcc is broken and has a non-SUSv2 compliant internal prototype. |
---|
5 | * This causes it to warn about a type mismatch here. Ignore it. */ |
---|
6 | int memcmp(const void *dst, const void *src, size_t count) { |
---|
7 | register int r; |
---|
8 | register const unsigned char *d=dst; |
---|
9 | register const unsigned char *s=src; |
---|
10 | ++count; |
---|
11 | while (--count) { |
---|
12 | if ((r=(*d - *s))) |
---|
13 | return r; |
---|
14 | ++d; |
---|
15 | ++s; |
---|
16 | } |
---|
17 | return 0; |
---|
18 | } |
---|
19 | |
---|
20 | int bcmp(const char *a,const char *b,size_t c) __attribute__((weak,alias("memcmp"))); |
---|
Note: See
TracBrowser
for help on using the repository browser.