binutils: fix build errors in 2.20 (patch from #6094)
[openwrt.git] / toolchain / uClibc / patches-0.9.30.1 / 110-compat_macros.patch
1 --- ./include/string.h.orig 2008-06-08 22:38:53.000000000 +0200
2 +++ ./include/string.h 2009-01-02 16:09:03.000000000 +0100
3 @@ -355,18 +355,40 @@
4 /* Find the last occurrence of C in S (same as strrchr). */
5 extern char *rindex (__const char *__s, int __c)
6 __THROW __attribute_pure__ __nonnull ((1));
7 -# else
8 -# ifdef __UCLIBC_SUSV3_LEGACY_MACROS__
9 +# elif defined(__UCLIBC_SUSV3_LEGACY_MACROS__) && !defined(_STRINGS_H)
10 /* bcopy/bzero/bcmp/index/rindex are marked LEGACY in SuSv3.
11 * They are replaced as proposed by SuSv3. Don't sync this part
12 * with glibc and keep it in sync with strings.h. */
13
14 -# define bcopy(src,dest,n) (memmove((dest), (src), (n)), (void) 0)
15 -# define bzero(s,n) (memset((s), '\0', (n)), (void) 0)
16 -# define bcmp(s1,s2,n) memcmp((s1), (s2), (size_t)(n))
17 -# define index(s,c) strchr((s), (c))
18 -# define rindex(s,c) strrchr((s), (c))
19 -# endif
20 +/* Copy N bytes of SRC to DEST (like memmove, but args reversed). */
21 +static __inline__ void bcopy (__const void *__src, void *__dest, size_t __n)
22 +{
23 + memmove(__dest, __src, __n);
24 +}
25 +
26 +/* Set N bytes of S to 0. */
27 +static __inline__ void bzero (void *__s, size_t __n)
28 +{
29 + memset(__s, 0, __n);
30 +}
31 +
32 +/* Compare N bytes of S1 and S2 (same as memcmp). */
33 +static __inline__ int bcmp (__const void *__s1, __const void *__s2, size_t __n)
34 +{
35 + return memcmp(__s1, __s2, __n);
36 +}
37 +
38 +/* Find the first occurrence of C in S (same as strchr). */
39 +static __inline__ char *index (__const char *__s, int __c)
40 +{
41 + return strchr(__s, __c);
42 +}
43 +
44 +/* Find the last occurrence of C in S (same as strrchr). */
45 +static __inline__ char *rindex (__const char *__s, int __c)
46 +{
47 + return strrchr(__s, __c);
48 +}
49 # endif
50
51 /* Return the position of the first bit set in I, or 0 if none are set.
This page took 0.04782 seconds and 5 git commands to generate.