zsh-workers
 help / color / mirror / code / Atom feed
From: "Jérémie Roquet" <arkanosis@gmail.com>
To: zsh-workers@zsh.org
Cc: Wayne Davison <wayned@users.sourceforge.net>
Subject: Re: [PATCH] Compilation fix for AIX (missing consts)
Date: Tue, 3 May 2011 14:23:04 +0200	[thread overview]
Message-ID: <BANLkTikwS5_jz+gx1eRmVEKDYfBx67Dg8A@mail.gmail.com> (raw)
In-Reply-To: <BANLkTi=TQndi16yPDyBefM_EasngLkRTFA@mail.gmail.com>

Hello,

Sorry, I've been away from AIX for a few days…

2011/4/27 Wayne Davison <wayned@users.sourceforge.net>:
> 2011/4/27 Jérémie Roquet <arkanosis@gmail.com>:
>> 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


  reply	other threads:[~2011-05-03 12:29 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 [this message]
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

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=BANLkTikwS5_jz+gx1eRmVEKDYfBx67Dg8A@mail.gmail.com \
    --to=arkanosis@gmail.com \
    --cc=wayned@users.sourceforge.net \
    --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).