From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9316 invoked from network); 22 Apr 2008 16:16:12 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 22 Apr 2008 16:16:12 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 96747 invoked from network); 22 Apr 2008 16:16:03 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 22 Apr 2008 16:16:03 -0000 Received: (qmail 10858 invoked by alias); 22 Apr 2008 16:15:59 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24862 Received: (qmail 10841 invoked from network); 22 Apr 2008 16:15:59 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 22 Apr 2008 16:15:59 -0000 Received: from cluster-g.mailcontrol.com (cluster-g.mailcontrol.com [85.115.41.190]) by bifrost.dotsrc.org (Postfix) with ESMTP id B0761808A37A for ; Tue, 22 Apr 2008 18:15:50 +0200 (CEST) Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly30g.srv.mailcontrol.com (MailControl) with ESMTP id m3MGFiGV028511 for ; Tue, 22 Apr 2008 17:15:44 +0100 Received: from news01 ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Tue, 22 Apr 2008 17:15:43 +0100 Date: Tue, 22 Apr 2008 17:15:43 +0100 From: Peter Stephenson To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: PATCH: alternative wcwidth() implementation Message-ID: <20080422171543.5bc9f519@news01> In-Reply-To: <31339.1208861418@csr.com> References: <31339.1208861418@csr.com> Organization: CSR X-Mailer: Claws Mail 3.3.1 (GTK+ 2.12.5; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 22 Apr 2008 16:15:43.0411 (UTC) FILETIME=[1D525830:01C8A494] X-Scanned-By: MailControl A-08-50-01 (www.mailcontrol.com) on 10.71.0.140 X-Virus-Scanned: ClamAV 0.91.2/6880/Tue Apr 22 16:13:41 2008 on bifrost X-Virus-Status: Clean On Tue, 22 Apr 2008 11:50:18 +0100 Peter Stephenson wrote: > I note we should supposedly be defining _XOPEN_SOURCE to get wcwidth(), > at least with glibc, but apparently generally don't (though I did for the > configure test). I'm a bit frightened of changing this, but POSIX does > suggest it's part of the XSI extension, so probably we ought to. > Indeed, we do define _XOPEN_SOURCE_EXTENDED if needed for curses.h; > probably the right thing to do is in the #else case, #define > _XOPEN_SOURCE if MULTIBYTE_SUPPORT is present. Let's try it. Index: Src/system.h =================================================================== RCS file: /cvsroot/zsh/zsh/Src/system.h,v retrieving revision 1.49 diff -u -r1.49 system.h --- Src/system.h 14 Dec 2007 15:14:06 -0000 1.49 +++ Src/system.h 22 Apr 2008 16:13:20 -0000 @@ -53,7 +53,12 @@ #endif #if defined(ZSH_CURSES_SOURCE) && defined(ZSH_CURSES_NEEDS_XOPEN) -#define _XOPEN_SOURCE_EXTENDED 1 +# define _XOPEN_SOURCE_EXTENDED 1 +#else +# ifdef MULTIBYTE_SUPPORT +/* Needed for wcwidth() which is part of XSI */ +# define _XOPEN_SOURCE 1 +# endif #endif /* -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070