Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh-4.3.4-dev-2.tar.gz

Vincent Lefevre wrote:
> Shouldn't HAVE_NCURSES_NCURSES_H and HAVE_NCURSES_H be reversed,
> in case both are defined? Indeed I assume that <ncurses/ncurses.h>
> should have the precedence over <ncurses.h> since the former is
> the canonical place, isn't it?

On the assumption that (i) only the original system packages are likely
to put the header in /usr/include (ii) added packages will put it in
some local subdirectory as ncurses/ncurses.h (iii) the added packages
should take preference and some attempt with include paths and library
paths has been made for this, then you're right.  That's a little too
complicated for me to have much faith that it's always going to work,
but at least you've provided one example where it does.

Index: Src/Modules/curses.c
RCS file: /cvsroot/zsh/zsh/Src/Modules/curses.c,v
retrieving revision 1.41
diff -u -r1.41 curses.c
--- Src/Modules/curses.c	20 Nov 2007 15:48:51 -0000	1.41
+++ Src/Modules/curses.c	21 Nov 2007 09:45:37 -0000
@@ -49,11 +49,11 @@
 #  include <ncursesw/ncurses.h>
 # else
-#  ifdef HAVE_NCURSES_H
-#   include <ncurses.h>
+#   include <ncurses/ncurses.h>
 #  else
-#    include <ncurses/ncurses.h>
+#   ifdef HAVE_NCURSES_H
+#    include <ncurses.h>
 #   else
 #    ifdef HAVE_CURSES_H
 #     include <curses.h>

Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070

Messages sorted by: Reverse Date, Date, Thread, Author