19 lines
280 B
C
19 lines
280 B
C
|
#include <string.h>
|
||
|
|
||
|
#ifndef __SUPPORT_ARCH_SH
|
||
|
|
||
|
int memcmp(void const *_s1, void const *_s2, size_t n)
|
||
|
{
|
||
|
char const *s1 = _s1;
|
||
|
char const *s2 = _s2;
|
||
|
|
||
|
for(size_t i = 0; i < n; i++) {
|
||
|
int d = s1[i] - s2[i];
|
||
|
if(d != 0) return d;
|
||
|
}
|
||
|
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
#endif /*__SUPPORT_ARCH_SH*/
|