Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Compilation fix for AIX (missing consts)
- X-seq: zsh-workers 29136
- From: Jérémie Roquet <arkanosis@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] Compilation fix for AIX (missing consts)
- Date: Tue, 3 May 2011 14:23:04 +0200
- Cc: Wayne Davison <wayned@xxxxxxxxxxxxxxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=/N/Xr5haT9WBYpFOiYFg75QiZkxFOBYc70n4JKz/hnk=; b=GQA5pJF8E4YjrVYYGCB/vnTByfHLawTsOhYZnVXN3Zq5/pXCPNPfPHRr48gGID3wL2 0D8lbO6dlaihAlFMGhFdHgiEieif+F+XRBmA//BlBoidIb3jlaMXNjVj3dF5siOvsZYI J4ObT2VB0ph0MajQkfGscKPE96CWQ6wAYYCjY=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=stLYY1LA4Yp+f36lNhPUr9kjph9yEmdvb45jkkbI31MEt+1wrEa6KzdFWu33WLEKkZ pR+iHYTPhGbugfuDoIOA347rHHHOdlxxamnmYvxSuif0b3BkP0GbHXZbflajIeR2FTOf 6l/SPaiSGREBQZTVy3rrfeD3RK4g8syvAw+AM=
- In-reply-to: <BANLkTi=TQndi16yPDyBefM_EasngLkRTFA@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <BANLkTi=wtU3LGu3vPbcD_DH5EQd=X9g0tw@mail.gmail.com> <BANLkTi=UQX0XKbUdhkiO_3-RYtSWPnvkkg@mail.gmail.com> <BANLkTi==gKWtBVbiWkQN=XgDUFoD7-OFCg@mail.gmail.com> <BANLkTi=TQndi16yPDyBefM_EasngLkRTFA@mail.gmail.com>
Hello,
Sorry, I've been away from AIX for a few days…
2011/4/27 Wayne Davison <wayned@xxxxxxxxxxxxxxxxxxxxx>:
> 2011/4/27 Jérémie Roquet <arkanosis@xxxxxxxxx>:
>> That's from the man for Linux and FreeBSD and from the source for AIX.
>
> In Linux they now have the extra "const"s in the include files, though
> not in the man pages.
>
>> Yes, it's conflicting with the available header.
>
> So, where are those defined in your /usr/include files? The best fix
> is to avoid manual prototypes on systems that have them already
> defined. So we should work out a rule that avoids including that
> section on AIX. What do the various TERM vars get defined as in
> config.h?
So… I have /usr/include/term.h and :
$ grep TERM config.h
/* #undef HAVE_NCURSESW_TERM_H */
/* #undef HAVE_NCURSES_TERM_H */
#define HAVE_SETUPTERM 1
/* #undef HAVE_TERMCAP_H */
#define HAVE_TERMIOS_H 1
#define HAVE_TERMIO_H 1
#define HAVE_TERM_H 1
#define ZSH_HAVE_TERM_H 1
$ grep CURSES config.h
#define HAVE_CURSES_H 1
#define HAVE_NCURSESW_NCURSES_H 1
#define HAVE_NCURSESW_TERM_H 1
#define HAVE_NCURSES_H 1
/* #undef HAVE_NCURSES_NCURSES_H */
/* #undef HAVE_NCURSES_TERM_H */
#define ZSH_HAVE_CURSES_H 1
$ grep TGETENT config.h
#define HAVE_TGETENT 1
#define TGETENT_ACCEPTS_NULL 1
#define TGETENT_SUCCESS 1
Which I think is fine.
But prototypes.h declares the prototypes whenever it is included if
!(defined(USES_TERMCAP_H) || defined(USES_TERM_H)); which means the
files that include it (ie. the files that include zsh.mdh, since it's
the only file to directly include prototypes.h) have to define one of
these macros before the inclusion.
That's what termcap.c does:
#include "../../config.h"
#ifdef HAVE_TGETENT
# if defined(ZSH_HAVE_CURSES_H) && defined(ZSH_HAVE_TERM_H)
# define USES_TERM_H 1
# else
# ifdef HAVE_TERMCAP_H
# define USES_TERMCAP_H 1
# endif
# endif
#endif
#include "termcap.mdh"
… but termcap.c is the only one to do that (along wtih terminfo.c
which always define the macro, regardless of the values in config.h).
Every other single file that include zsh.mdh (and prototypes.h) does
not set USES_*.
For example, loop.c, prompt.c, sort.c… (there are about ~30 of them)
include zsh.mdh (and prototypes.h) without defining USES_* so they
declare the prototypes even when the HAVE_* macros are defined.
I may have missed something, but I think it's the whole problem.
Best regards,
--
Jérémie
Messages sorted by:
Reverse Date,
Date,
Thread,
Author