loadfile: make sure we don't trash errno
[syslinux.git] / memdump / string.h
blob44f77dac606d157b040af602ee270b8457d27bba
1 /*
2 * string.h
3 */
5 #ifndef _STRING_H
6 #define _STRING_H
8 /* Standard routines */
9 #define memcpy(a,b,c) __builtin_memcpy(a,b,c)
10 #define memset(a,b,c) __builtin_memset(a,b,c)
11 #define strcpy(a,b) __builtin_strcpy(a,b)
12 #define strlen(a) __builtin_strlen(a)
14 /* This only returns true or false */
15 static inline int memcmp(const void *__m1, const void *__m2, unsigned int __n)
17 _Bool rv;
18 asm volatile("cld ; repe ; cmpsb ; setne %0"
19 : "=abd" (rv), "+D" (__m1), "+S" (__m2), "+c" (__n));
20 return rv;
23 #endif /* _STRING_H */