diff options
| author | "Steven J. Hill" <sjhill@realitydiluted.com> | 2006-08-21 04:46:41 +0000 |
|---|---|---|
| committer | "Steven J. Hill" <sjhill@realitydiluted.com> | 2006-08-21 04:46:41 +0000 |
| commit | 6ebb3d3f654b88641ceba4c1d4de8d6d211cb198 (patch) | |
| tree | a86bc6be6f4ffdd01ab055ea7231a673718df6b2 /include/string.h | |
| parent | 915d3c5ab2a1cfbad8c2d1fa733bf3653a23a1a0 (diff) | |
| download | uClibc-alpine-6ebb3d3f654b88641ceba4c1d4de8d6d211cb198.tar.bz2 uClibc-alpine-6ebb3d3f654b88641ceba4c1d4de8d6d211cb198.tar.xz | |
Merge from trunk.
Diffstat (limited to 'include/string.h')
| -rw-r--r-- | include/string.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/string.h b/include/string.h index a98248c96..dd5f23f2b 100644 --- a/include/string.h +++ b/include/string.h @@ -301,6 +301,7 @@ extern void __bzero (void *__s, size_t __n) __THROW __nonnull ((1)); #endif #ifdef __USE_BSD +# ifdef __UCLIBC_SUSV3_LEGACY__ /* Copy N bytes of SRC to DEST (like memmove, but args reversed). */ extern void bcopy (__const void *__src, void *__dest, size_t __n) __THROW __nonnull ((1, 2)); @@ -319,6 +320,17 @@ extern char *index (__const char *__s, int __c) /* Find the last occurrence of C in S (same as strrchr). */ extern char *rindex (__const char *__s, int __c) __THROW __attribute_pure__ __nonnull ((1)); +# else +/* bcopy/bzero/bcmp/index/rindex are marked LEGACY in SuSv3. + * They are replaced as proposed by SuSv3. Don't sync this part + * with glibc and keep it in sync with strings.h. */ + +# define bcopy(src,dest,n) (memmove((dest), (src), (n)), (void) 0) +# define bzero(s,n) (memset((s), '\0', (n)), (void) 0) +# define bcmp(s1,s2,n) memcmp((s1), (s2), (size_t)(n)) +# define index(s,c) strchr((s), (c)) +# define rindex(s,c) strrchr((s), (c)) +# endif /* Return the position of the first bit set in I, or 0 if none are set. The least-significant bit is position 1, the most-significant 32. */ |
