23
23
#define __HAVE_ARCH_MEMSET
24
24
extern void * __constant_c_memset(void *, unsigned long, size_t);
25
extern void * ___memset(void *, int, size_t);
25
26
extern void * __memset(void *, int, size_t);
26
27
extern void * memset(void *, int, size_t);
28
#define memset(s, c, n) \
29
(__builtin_constant_p(c) \
30
? (__builtin_constant_p(n) && (c) == 0 \
31
? __builtin_memset((s),0,(n)) \
32
: __constant_c_memset((s),0x0101010101010101UL*(unsigned char)(c),(n))) \
33
: __memset((s),(c),(n)))
29
/* For gcc 3.x, we cannot have the inline function named "memset" because
30
the __builtin_memset will attempt to resolve to the inline as well,
31
leading to a "sorry" about unimplemented recursive inlining. */
32
extern inline void *__memset(void *s, int c, size_t n)
34
if (__builtin_constant_p(c)) {
35
if (__builtin_constant_p(n)) {
36
return __builtin_memset(s, c, n);
38
unsigned long c8 = (c & 0xff) * 0x0101010101010101UL;
39
return __constant_c_memset(s, c8, n);
42
return ___memset(s, c, n);
45
#define memset __memset
35
47
#define __HAVE_ARCH_STRCPY
36
48
extern char * strcpy(char *,const char *);