From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19542 invoked by alias); 3 May 2011 11:21:52 -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: 29134 Received: (qmail 22997 invoked from network); 3 May 2011 11:21:50 -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.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at csr.com does not designate permitted sender hosts) Date: Tue, 3 May 2011 11:23:24 +0100 From: Peter Stephenson To: Subject: Re: [PATCH] Compilation fix for AIX (missing consts) Message-ID: <20110503112324.77c6244e@pwslap01u.europe.root.pri> In-Reply-To: References: Organization: Cambridge Silicon Radio X-Mailer: Claws Mail 3.7.8 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.103.11.49] X-Scanned-By: MailControl A_10_80_00 (www.mailcontrol.com) on 10.68.0.163 On Tue, 26 Apr 2011 15:33:52 +0200 J=C3=A9r=C3=A9mie Roquet wrote: > 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=E2=80=A6 > I'm not sure it doesn't break some other platform, but at least these > are the right protos for AIX, Linux and FreeBSD. >=20 > Any thoughts on this? As Wayne says, we really need to find the headers, but until then the following should at least be safe... although this code hasn't change for a very long time, and it used to compile on AIX, so it's possible there's a version issue (the other possibility is it's a local configuration issue). Index: Src/prototypes.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/zsh/zsh/Src/prototypes.h,v retrieving revision 1.5 diff -p -u -r1.5 prototypes.h --- Src/prototypes.h 20 Dec 2010 10:28:43 -0000 1.5 +++ Src/prototypes.h 3 May 2011 10:20:43 -0000 @@ -34,12 +34,24 @@ char *calloc _((size_t, size_t)); #endif =20 #if !(defined(USES_TERMCAP_H) || defined(USES_TERM_H)) -extern int tgetent _((char *bp, char *name)); +/* + * These prototypes are only used where we don't have the + * headers. In some cases they need tweaking. + * TBD: we'd much prefer to get hold of the header where + * these are defined. + */ +#ifdef _AIX +#define TC_CONST const +#else +#define TC_CONST +#endif +extern int tgetent _((char *bp, TC_CONST char *name)); extern int tgetnum _((char *id)); extern int tgetflag _((char *id)); extern char *tgetstr _((char *id, char **area)); -extern char *tgoto _((char *cm, int destcol, int destline)); -extern int tputs _((char *cp, int affcnt, int (*outc) (int))); +extern char *tgoto _((TC_CONST char *cm, int destcol, int destline)); +extern int tputs _((TC_CONST char *cp, int affcnt, int (*outc) (int))); +#undef TC_CONST #endif =20 /* MISSING PROTOTYPES FOR VARIOUS OPERATING SYSTEMS */ --=20 Peter Stephenson Software Engineer Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, = UK Member of the CSR plc group of companies. CSR plc registered in England and= Wales, registered number 4187346, registered office Churchill House, Cambr= idge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom