From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23608 invoked by alias); 3 May 2011 12:29:23 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 29136 Received: (qmail 4343 invoked from network); 3 May 2011 12:29:12 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, T_TO_NO_BRKTS_FREEMAIL autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.215.171 as permitted sender) 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= MIME-Version: 1.0 In-Reply-To: References: From: =?UTF-8?B?SsOpcsOpbWllIFJvcXVldA==?= Date: Tue, 3 May 2011 14:23:04 +0200 Message-ID: Subject: Re: [PATCH] Compilation fix for AIX (missing consts) To: zsh-workers@zsh.org Cc: Wayne Davison Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello, Sorry, I've been away from AIX for a few days=E2=80=A6 2011/4/27 Wayne Davison : > 2011/4/27 J=C3=A9r=C3=A9mie Roquet : >> 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? =C2=A0The best fi= x > is to avoid manual prototypes on systems that have them already > defined. =C2=A0So we should work out a rule that avoids including that > section on AIX. =C2=A0What do the various TERM vars get defined as in > config.h? So=E2=80=A6 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" =E2=80=A6 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=E2=80=A6 (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, --=20 J=C3=A9r=C3=A9mie