900-iconv_size_hack.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. @@ -53,6 +55,7 @@ static const unsigned short legacy_chars
  19. #include "legacychars.h"
  20. };
  21. +#ifdef FULL_ICONV
  22. static const unsigned short jis0208[84][94] = {
  23. #include "jis0208.h"
  24. };
  25. @@ -72,6 +75,7 @@ static const unsigned short hkscs[] = {
  26. static const unsigned short ksc[93][94] = {
  27. #include "ksc.h"
  28. };
  29. +#endif
  30. static int fuzzycmp(const unsigned char *a, const unsigned char *b)
  31. {
  32. @@ -216,6 +220,7 @@ size_t iconv(iconv_t cd0, char **restric
  33. c = ((c-0xd7c0)<<10) + (d-0xdc00);
  34. }
  35. break;
  36. +#ifdef FULL_ICONV
  37. case SHIFT_JIS:
  38. if (c-0xa1 <= 0xdf-0xa1) {
  39. c += 0xff61-0xa1;
  40. @@ -362,6 +367,7 @@ size_t iconv(iconv_t cd0, char **restric
  41. c = ksc[c][d];
  42. if (!c) goto ilseq;
  43. break;
  44. +#endif
  45. default:
  46. if (c < 128+type) break;
  47. c -= 128+type;
  48. --- a/src/locale/codepages.h
  49. +++ b/src/locale/codepages.h
  50. @@ -118,6 +118,7 @@
  51. "\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"
  52. "\230\0\0\0\0\0\44\341\12\0"
  53. +#ifdef FULL_ICONV
  54. "cp1250\0"
  55. "windows1250\0"
  56. "\0\0"
  57. @@ -214,6 +215,7 @@
  58. "\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"
  59. "\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"
  60. "\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"
  61. +#endif
  62. "koi8r\0"
  63. "\0\0"