let ipkg fail when a package file to be installed is not found
[openwrt/staging/wigyori.git] / openwrt / toolchain / uClibc / patches / 140-uclibc_do_div_ldso.patch
1 diff -ur uClibc-0.9.28/ldso/include/dl-string.h uClibc-0.9.28.openwrt/ldso/include/dl-string.h
2 --- uClibc-0.9.28/ldso/include/dl-string.h 2005-08-18 00:49:41.000000000 +0200
3 +++ uClibc-0.9.28.openwrt/ldso/include/dl-string.h 2006-04-12 11:07:49.000000000 +0200
4 @@ -4,6 +4,14 @@
5 #include <dl-sysdep.h> // for do_rem
6 #include <features.h>
7
8 +/* provide some sane defaults */
9 +#ifndef do_rem
10 +# define do_rem(result, n, base) ((result) = (n) % (base))
11 +#endif
12 +#ifndef do_div_10
13 +# define do_div_10(result, remain) ((result) /= 10)
14 +#endif
15 +
16 static size_t _dl_strlen(const char * str);
17 static char *_dl_strcat(char *dst, const char *src);
18 static char * _dl_strcpy(char * dst,const char *src);
19 @@ -228,7 +236,7 @@
20 char temp;
21 do_rem(temp, i, 10);
22 *--p = '0' + temp;
23 - i /= 10;
24 + do_div_10(i, temp);
25 } while (i > 0);
26 return p;
27 }
28 @@ -318,7 +326,7 @@
29 do { \
30 do_rem(v, (X), 10); \
31 *--tmp2 = '0' + v; \
32 - (X) /= 10; \
33 + do_div_10((X), v); \
34 } while ((X) > 0); \
35 _dl_write(2, tmp2, tmp1 - tmp2 + sizeof(tmp) - 1); \
36 }
37 diff -ur uClibc-0.9.28/ldso/ldso/arm/dl-sysdep.h uClibc-0.9.28.openwrt/ldso/ldso/arm/dl-sysdep.h
38 --- uClibc-0.9.28/ldso/ldso/arm/dl-sysdep.h 2005-08-18 00:49:41.000000000 +0200
39 +++ uClibc-0.9.28.openwrt/ldso/ldso/arm/dl-sysdep.h 2006-04-12 11:31:58.000000000 +0200
40 @@ -43,6 +43,7 @@
41 return m;
42 }
43 #define do_rem(result, n, base) ((result) = arm_modulus(n, base))
44 +#define do_div_10(result, remain) ((result) = (((result) - (remain)) / 2) * -(-1ul / 5ul))
45
46 /* Here we define the magic numbers that this dynamic loader should accept */
47 #define MAGIC1 EM_ARM