Oh, prototypes for fallback functions are a hassle. I just don't know what to do with them, honestly.
On on hand, supplying prototypes for functions that are defined in libc sometimes breaks things, like in this case where it would seem the prototype in NetBSD libc is incompatible with the one fish has. On the other hand, sometimes libc provides a function but no prototype. This is true for instance with glibc and the *wprintf functions. In order to get these function prototypes, you need to supply the --std=c99 switch to the compiler, but even if you don't, the actual functions are there. In order to get prototypes for some additional wcs* functions, you also need to supply additional #defines. If somebody has input on how this could be handled without breaking on any platforms, and without adding gcc-specific switches, please speak up. -- Axel On 3/23/06, Hiroshi SAKURAI <[EMAIL PROTECTED]> wrote: > Hi, > > Compiling fish-1.21.2 on NetBSD fails. > > putwc is defined as follows in /usr/include/wchar.h. > > #define getwc(f) fgetwc(f) > #define getwchar() getwc(stdin) > #define putwc(wc, f) fputwc((wc), (f)) > #define putwchar(wc) putwc((wc), stdout) > > putwc prototype in fallback.h expands as follows that leads to > compile error. > > -> wint_t fputwc((wchar_t wc), (FILE *stream)); > > I think putwc should be #ifdef-ed. > > > Index: fallback.h > =================================================================== > --- fallback.h (revision 761) > +++ fallback.h (working copy) > @@ -79,6 +79,7 @@ > */ > int vswprintf( wchar_t *out, size_t n, const wchar_t *filter, va_list va ); > > +#ifndef HAVE_FGETWC > /** > Fallback implementation of fgetwc > */ > @@ -88,7 +89,9 @@ > Fallback implementation of getwc > */ > wint_t getwc(FILE *stream); > +#endif > > +#ifndef HAVE_FPUTWC > /** > Fallback implementation of fputwc > */ > @@ -97,6 +100,7 @@ > Fallback implementation of putwc > */ > wint_t putwc(wchar_t wc, FILE *stream); > +#endif > > /** > Fallback implementation of wcstok. Uses code borrowed from glibc. > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmdlnk&kid0944&bid$1720&dat1642 > _______________________________________________ > Fish-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/fish-users > -- Axel ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642 _______________________________________________ Fish-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/fish-users
