mirror of
https://github.com/darlinghq/cctools-port.git
synced 2024-11-23 04:09:48 +00:00
Add missing file
This commit is contained in:
parent
5e9c52005f
commit
9fa76fb95a
40
cctools/include/foreign/strings.h
Normal file
40
cctools/include/foreign/strings.h
Normal file
@ -0,0 +1,40 @@
|
||||
#include_next <strings.h>
|
||||
|
||||
#undef bcmp
|
||||
#undef bzero
|
||||
#undef bcopy
|
||||
|
||||
#ifndef HAVE_BCMP
|
||||
static inline int bcmp(const void *s1, const void *s2, size_t n)
|
||||
{
|
||||
return __builtin_memcmp(s1, s2, n);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_BZERO
|
||||
static inline void bzero(void *s, size_t n)
|
||||
{
|
||||
__builtin_memset(s, '\0', n);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_BCOPY
|
||||
static inline void bcopy(const void *src, void *dest, size_t n)
|
||||
{
|
||||
__builtin_memcpy(dest, src, n);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_INDEX
|
||||
static inline char *index(const char *s, int c)
|
||||
{
|
||||
return __builtin_strchr(s, c);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_RINDEX
|
||||
static inline char *rindex(const char *s, int c)
|
||||
{
|
||||
return __builtin_strrchr(s, c);
|
||||
}
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user