Closed awik32 closed 4 years ago
Looking at the DJGPP headers it appears that it has some minimal wide character support but doesn't support the restartable API. It may be possible for you to use mbtowc() and wctomb() instead of mbrtowc() and wcrtomb() and avoid those messy #ifdefs. I'm not sure why awk needs to use the restartable versions since it is converting a single string at a time. It may be that the non-restartable versions are fine.
Hi,
On Fri, 31 Jul 2020 at 19:42, Todd C. Miller notifications@github.com wrote:
Looking at the DJGPP headers it appears that it has some minimal wide character support but doesn't support the restartable API. It may be possible for you to use mbtowc() and wctomb() instead of mbrtowc() and wcrtomb() and avoid those messy #ifdefs. I'm not sure why awk needs to use the restartable versions since it is converting a single string at a time. It may be that the non-restartable versions are fine.
I'd rather have awk be (more) 8-bit clean than support foreign characters. I don't want multi-byte sequences (as in UTF8) be interpreted as single characters.
-Albert.
@millert 's suggestion is the correct way to go. It solves the portability issue without requiring lots of ifdefs and without breaking the functionality. I have pushed this change to the repo. Thanks for the report.
I have pushed additional fixes for DJGPP that should now allow awk
to compile on that platform. Enjoy.
The patch attached below works around a problem with wide chars, so that AWK compiles under DJGPP.
djgpp-patch.diff.gz