musl: update to version 1.1.10+git
[openwrt.git] / toolchain / musl / patches / 900-iconv_size_hack.patch
1 --- a/src/locale/iconv.c
2 +++ b/src/locale/iconv.c
3 @@ -39,6 +39,7 @@ static const unsigned char charmaps[] =
4  "ucs4\0ucs4be\0utf32\0utf32be\0\0\300"
5  "ucs4le\0utf32le\0\0\303"
6  "ascii\0usascii\0iso646\0iso646us\0\0\307"
7 +#ifdef FULL_ICONV
8  "eucjp\0\0\320"
9  "shiftjis\0sjis\0\0\321"
10  "gb18030\0\0\330"
11 @@ -46,6 +47,7 @@ static const unsigned char charmaps[] =
12  "gb2312\0\0\332"
13  "big5\0bigfive\0cp950\0big5hkscs\0\0\340"
14  "euckr\0ksc5601\0ksx1001\0cp949\0\0\350"
15 +#endif
16  #include "codepages.h"
17  ;
18  
19 @@ -53,6 +55,7 @@ static const unsigned short legacy_chars
20  #include "legacychars.h"
21  };
22  
23 +#ifdef FULL_ICONV
24  static const unsigned short jis0208[84][94] = {
25  #include "jis0208.h"
26  };
27 @@ -72,6 +75,7 @@ static const unsigned short hkscs[] = {
28  static const unsigned short ksc[93][94] = {
29  #include "ksc.h"
30  };
31 +#endif
32  
33  static int fuzzycmp(const unsigned char *a, const unsigned char *b)
34  {
35 @@ -216,6 +220,7 @@ size_t iconv(iconv_t cd0, char **restric
36                                 c = ((c-0xd7c0)<<10) + (d-0xdc00);
37                         }
38                         break;
39 +#ifdef FULL_ICONV
40                 case SHIFT_JIS:
41                         if (c-0xa1 <= 0xdf-0xa1) {
42                                 c += 0xff61-0xa1;
43 @@ -362,6 +367,7 @@ size_t iconv(iconv_t cd0, char **restric
44                         c = ksc[c][d];
45                         if (!c) goto ilseq;
46                         break;
47 +#endif
48                 default:
49                         if (c < 128+type) break;
50                         c -= 128+type;
51 --- a/src/locale/codepages.h
52 +++ b/src/locale/codepages.h
53 @@ -118,6 +118,7 @@
54  "\0\0\0\100\15\0\344\0\0\0\0\0\0\0\0\0\0\0\0\0\103\270\1\0\0\0\340\1\200\40"
55  "\230\0\0\0\0\0\44\341\12\0"
56  
57 +#ifdef FULL_ICONV
58  "cp1250\0"
59  "windows1250\0"
60  "\0\0"
61 @@ -214,6 +215,7 @@
62  "\0\0\0\0\0\0\0\0\0\15\0\0\0\0\0\0\0\0\0\0\266\0\0\0\0\102\0\220\13\0"
63  "\0\234\2\0\0\0\0\0\0\0\0\244\202\13\0\0\0\0\100\15\0\0\0\0\0\0\0\0\0\0"
64  "\267\0\0\0\0\103\0\240\13\0\0\240\2\0\0\0\0\0\0\0\0\250\62\45\0"
65 +#endif
66  
67  "koi8r\0"
68  "\0\0"