0001-fix-build-without-wchar.patch 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. Don't reference wchar_t when D2U_UNICODE is not defined.
  2. Patch status: upstream (http://sourceforge.net/p/dos2unix/code/736)
  3. Signed-off-by: Baruch Siach <baruch@tkos.co.il>
  4. diff -Nuar dos2unix-7.3.orig/common.c dos2unix-7.3/common.c
  5. --- dos2unix-7.3.orig/common.c 2015-08-21 02:02:31.000000000 +0300
  6. +++ dos2unix-7.3/common.c 2015-09-02 22:13:33.648486366 +0300
  7. @@ -1615,9 +1615,11 @@
  8. } else if (pFlag->status & WRONG_CODEPAGE) {
  9. d2u_fprintf(stderr,"%s: ",progname);
  10. d2u_fprintf(stderr, _("code page %d is not supported.\n"), pFlag->ConvMode);
  11. +#ifdef D2U_UNICODE
  12. } else if (pFlag->status & WCHAR_T_TOO_SMALL) {
  13. d2u_fprintf(stderr,"%s: ",progname);
  14. d2u_fprintf(stderr, _("Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n"), "stdin", (int)sizeof(wchar_t));
  15. +#endif
  16. } else if (pFlag->status & UNICODE_CONVERSION_ERROR) {
  17. d2u_fprintf(stderr,"%s: ",progname);
  18. d2u_fprintf(stderr, _("Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n"), "stdin", pFlag->line_nr);
  19. @@ -1701,9 +1703,11 @@
  20. } else if (pFlag->status & WRONG_CODEPAGE) {
  21. d2u_fprintf(stderr,"%s: ",progname);
  22. d2u_fprintf(stderr, _("code page %d is not supported.\n"), pFlag->ConvMode);
  23. +#ifdef D2U_UNICODE
  24. } else if (pFlag->status & WCHAR_T_TOO_SMALL) {
  25. d2u_fprintf(stderr,"%s: ",progname);
  26. d2u_fprintf(stderr, _("Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n"), infile, (int)sizeof(wchar_t));
  27. +#endif
  28. } else if (pFlag->status & UNICODE_CONVERSION_ERROR) {
  29. d2u_fprintf(stderr,"%s: ",progname);
  30. d2u_fprintf(stderr, _("Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n"), infile, pFlag->line_nr);
  31. @@ -1781,9 +1785,11 @@
  32. } else if (pFlag->status & WRONG_CODEPAGE) {
  33. d2u_fprintf(stderr,"%s: ",progname);
  34. d2u_fprintf(stderr, _("code page %d is not supported.\n"), pFlag->ConvMode);
  35. +#ifdef D2U_UNICODE
  36. } else if (pFlag->status & WCHAR_T_TOO_SMALL) {
  37. d2u_fprintf(stderr,"%s: ",progname);
  38. d2u_fprintf(stderr, _("Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n"), infile, (int)sizeof(wchar_t));
  39. +#endif
  40. } else if (pFlag->status & UNICODE_CONVERSION_ERROR) {
  41. d2u_fprintf(stderr,"%s: ",progname);
  42. d2u_fprintf(stderr, _("Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n"), infile, pFlag->line_nr);
  43. @@ -1834,11 +1840,13 @@
  44. d2u_fprintf(stderr,"%s: ",progname);
  45. d2u_fprintf(stderr, _("Skipping symbolic link %s, target is not a regular file.\n"), infile);
  46. }
  47. +#ifdef D2U_UNICODE
  48. } else if (pFlag->status & WCHAR_T_TOO_SMALL) {
  49. if (pFlag->verbose) {
  50. d2u_fprintf(stderr,"%s: ",progname);
  51. d2u_fprintf(stderr, _("Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n"), infile, (int)sizeof(wchar_t));
  52. }
  53. +#endif
  54. }
  55. }