source: trunk/sys/dietlibc/memcmp.c @ 412

Last change on this file since 412 was 1, checked in by alain, 7 years ago

First import

File size: 530 bytes
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. */
6int 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
20int bcmp(const char *a,const char *b,size_t c)  __attribute__((weak,alias("memcmp")));
Note: See TracBrowser for help on using the repository browser.