Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] Compilation fix for AIX (missing consts)



2011/4/26 Wayne Davison <wayned@xxxxxxxxxxxxxxxxxxxxx>:
> 2011/4/26 Jérémie Roquet <arkanosis@xxxxxxxxx>:
>> I've had to fix the source to compile zsh on AIX. It looks like the
>> protos were wrong anyway, but gcc doesn't complain on Linux…
>
> Yeah, that section doesn't get included on Linux, since it has the
> prototypes available in the public term.h and termcap.h.

Of course… stupid me :-)

> I (temporarily) commented out the #if/#endif lines and made all the
> changes necessary to get it to compile without error, which also
> required adding a "const" to the 3 "char *id" args that you didn't
> change.

Well, I didn't change them because it doesn't match the protos which
are (copy-paste) :

  int tgetent(char *bp, const char *name);
  int tgetflag(char *id);
  int tgetnum(char *id);
  char *tgetstr(char *id, char **area);
  char *tgoto(const char *cap, int col, int row);
  int tputs(const char *str, int affcnt, int (*putc)(int));

That's from the man for Linux and FreeBSD and from the source for AIX.

> Since that section of the file is only supposed to be used
> when the public prototypes aren't available, that should be better
> than what we had before.

Thanks!

> Does AIX have a conflicting header file?  Or just the calls weren't
> matching the prototypes?  If the former, you may want to look into why
> the Src/Modules/termcap.c code isn't setting either USES_TERMCAP_H or
> USES_TERM_H for AIX.

Yes, it's conflicting with the available header.

I haven't spent much time checking who includes who, but it seems that
prototypes.h is included by zsh,mdh which also includes config.h
beforehand but neither defines USES_TERMCAP_H nor USES_TERM_H (which
is done, as expected, by termcap.c).

Best regards,

-- 
Jérémie



Messages sorted by: Reverse Date, Date, Thread, Author