cisco / ChezScheme

Chez Scheme
Apache License 2.0
6.99k stars 987 forks source link

fix missing `wcwidth` declaration on GNU Hurd #853

Closed weinholt closed 4 months ago

weinholt commented 4 months ago

Building on Debian GNU/Hurd i386 fails because of an implicit declaration of wcwidth. This commit makes GNU/Hurd use the same declaration that is used on GNU/Linux.

mflatt commented 4 months ago

I didn't manage to try this myself, but the change makes sense. Thanks!

LiberalArtist commented 3 months ago

Thanks for this repair! @weinholt, I noticed that you are checking defined(__gnu_hurd__) here. When I added Hurd support, I used defined(__GNU__) based on https://www.gnu.org/software/hurd/hurd/porting/guidelines.html—but I don't actually have particular experience with the Hurd; I just maintain the distro packaging of Chez for Guix.

I actually think I prefer defined(__gnu_hurd__) as more self-documenting: there are lots of GNU things one might reasonably want to check for, and in fact I tended to write things more like defined(__GNU__) /* Hurd */. Do you have a reference for __gnu_hurd__ being defined?

weinholt commented 3 months ago

Do you have a reference for __gnu_hurd__ being defined?

A GCC changelog entry from 2002 and observed behavior: gcc -dM -E - < /dev/null. In the GCC source code tree, __gnu_hurd__ and __GNU__ are both defined in gcc/config/gnu.h.