zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <Peter.Stephenson@csr.com>
To: <zsh-workers@zsh.org>
Subject: Re: [PATCH] Compilation fix for AIX (missing consts)
Date: Tue, 3 May 2011 11:23:24 +0100	[thread overview]
Message-ID: <20110503112324.77c6244e@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <BANLkTi=wtU3LGu3vPbcD_DH5EQd=X9g0tw@mail.gmail.com>

On Tue, 26 Apr 2011 15:33:52 +0200
Jérémie Roquet <arkanosis@gmail.com> 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…
> I'm not sure it doesn't break some other platform, but at least these
> are the right protos for AIX, Linux and FreeBSD.
> 
> 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
===================================================================
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
 
 #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
 
 /* MISSING PROTOTYPES FOR VARIOUS OPERATING SYSTEMS */

-- 
Peter Stephenson <pws@csr.com>            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, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom


      parent reply	other threads:[~2011-05-03 11:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-26 13:33 Jérémie Roquet
2011-04-26 19:16 ` Wayne Davison
2011-04-27 15:49   ` Jérémie Roquet
2011-04-27 18:54     ` Wayne Davison
2011-05-03 12:23       ` Jérémie Roquet
2011-05-06 13:51         ` Peter Stephenson
2011-05-06 14:16           ` Peter Stephenson
2011-05-09  9:54           ` Peter Stephenson
2011-05-09 10:33             ` Peter Stephenson
2011-05-03 10:23 ` Peter Stephenson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110503112324.77c6244e@pwslap01u.europe.root.pri \
    --to=peter.stephenson@csr.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).