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

Re: zsh 4.3.6 FreeBSD bug



On Sun, 4 May 2008 13:19:13 +0100
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:
> I've now defined _XOPEN_SOURCE_EXTENDED to get wcwidth() even if curses
> doesn't need it, because that's an XSI function; presumably that doesn't
> want to happen on BSD either (it'll appear in the scope of the curses
> files)?  If so we'll need to revise the scope of the definition you
> changed to mean never define _XOPEN_SOURCE_EXTENDED.

I think we probably want something like this.

Index: configure.ac
===================================================================
RCS file: /cvsroot/zsh/zsh/configure.ac,v
retrieving revision 1.99
diff -u -r1.99 configure.ac
--- configure.ac	26 Apr 2008 17:46:46 -0000	1.99
+++ configure.ac	4 May 2008 18:37:06 -0000
@@ -682,20 +682,20 @@
    termcap_curses_order="$ncursesw_test tinfo termcap $ncurses_test curses" ;;
 esac])dnl
 
-AH_TEMPLATE([ZSH_CURSES_NEEDS_XOPEN],
-[Define if the curses libraries need _XOPEN_SOURCE_EXTENDED defined])
-AC_CACHE_CHECK(if the curses library needs _XOPEN_SOURCE_EXTENDED,
-zsh_cv_curses_needs_xopen,
+AH_TEMPLATE([ZSH_NO_XOPEN],
+[Define if _XOPEN_SOURCE_EXTENDED should not be defined to avoid clashes])
+AC_CACHE_CHECK(if _XOPEN_SOURCE_EXTENDED should not be defined,
+zsh_cv_no_xopen,
 [case "$host_os" in
-  *openbsd*)
-  zsh_cv_curses_needs_xopen=no
+  *openbsd*|*freebsd*)
+  zsh_cv_no_xopen=yes
   ;;
   *)
-  zsh_cv_curses_needs_xopen=yes
+  zsh_cv_no_xopen=no
   ;;
 esac])
-if test x$zsh_cv_curses_needs_xopen = xyes; then
-  AC_DEFINE(ZSH_CURSES_NEEDS_XOPEN)
+if test x$zsh_cv_no_xopen = xyes; then
+  AC_DEFINE(ZSH_NO_XOPEN)
 fi
 
 dnl Check for tigetflag (terminfo) before tgetent (termcap).
Index: Src/system.h
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/system.h,v
retrieving revision 1.51
diff -u -r1.51 system.h
--- Src/system.h	23 Apr 2008 10:35:29 -0000	1.51
+++ Src/system.h	4 May 2008 18:37:10 -0000
@@ -52,19 +52,20 @@
 # undef HAVE_SYS_UTSNAME_H
 #endif
 
-#if defined(ZSH_CURSES_SOURCE) && defined(ZSH_CURSES_NEEDS_XOPEN)
-# define _XOPEN_SOURCE_EXTENDED 1
-#else
-# ifdef MULTIBYTE_SUPPORT
+#ifndef ZSH_NO_XOPEN
+# ifdef ZSH_CURSES_SOURCE
+#  define _XOPEN_SOURCE_EXTENDED 1
+# else
+#  ifdef MULTIBYTE_SUPPORT
 /*
  * Needed for wcwidth() which is part of XSI.
  * Various other uses of the interface mean we can't get away with just
  * _XOPEN_SOURCE.
  */
-/*#  define _XOPEN_SOURCE 1*/
-#  define _XOPEN_SOURCE_EXTENDED 1
-# endif
-#endif
+#   define _XOPEN_SOURCE_EXTENDED 1
+#  endif /* MULTIBYTE_SUPPORT */
+# endif /* ZSH_CURSES_SOURCE */
+#endif /* ZSH_NO_XOPEN */
 
 /*
  * Solaris by default zeroes all elements of the tm structure in

-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



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