From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24766 invoked by alias); 7 Aug 2012 03:12:57 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 30599 Received: (qmail 7116 invoked from network); 7 Aug 2012 03:12:55 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.2 Received-SPF: softfail (ns1.primenet.com.au: transitioning SPF record at spf04.biglobe.ne.jp does not designate 149.20.53.66 as permitted sender) To: zsh-workers@zsh.org Subject: Re: wcwidth autoconf bug In-Reply-To: Your message of "Mon, 6 Aug 2012 06:32:40 +0000 (UTC)" <20120806063240.31AFE14A3DF@mail.netbsd.org> References: <20120806063240.31AFE14A3DF@mail.netbsd.org> X-Mailer: Cue version 0.8 (111031-0948/takashi) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Message-Id: <20120807031251.ECE9914A601@mail.netbsd.org> Date: Tue, 7 Aug 2012 03:12:51 +0000 (UTC) From: yamt@mwd.biglobe.ne.jp (YAMAMOTO Takashi) > hi, > >> Not as far as I can see. The programme is designed to return 0 >> (success) if it's been through all the stages of the test to see if >> wcwidth is present but broken. In that case the variable should be set >> to "yes". > > ah, i misunderstood the intention of the code. > thanks for explanation. even if libc wcwidth is broken in the sense of this test, it has a far better chance to work than the alternative implementation on non-__STDC_ISO_10646__ platforms. YAMAMOTO Takashi diff --git a/Src/compat.c b/Src/compat.c index e36de32..6d08dab 100644 --- a/Src/compat.c +++ b/Src/compat.c @@ -630,7 +630,7 @@ strtoul(nptr, endptr, base) #endif /* HAVE_STRTOUL */ /**/ -#ifdef BROKEN_WCWIDTH +#if defined(BROKEN_WCWIDTH) && defined(__STDC_ISO_10646__) /* * This is an implementation of wcwidth() and wcswidth() (defined in @@ -949,5 +949,5 @@ int mk_wcswidth_cjk(const wchar_t *pwcs, size_t n) #endif /* 0 */ /**/ -#endif /* BROKEN_WCWIDTH */ +#endif /* BROKEN_WCWIDTH && __STDC_ISO_10646__ */ diff --git a/Src/zsh.h b/Src/zsh.h index cc3a670..afe22f0 100644 --- a/Src/zsh.h +++ b/Src/zsh.h @@ -2678,7 +2678,7 @@ typedef wint_t convchar_t; #define MB_METASTRWIDTH(str) mb_metastrlen(str, 1) #define MB_METASTRLEN2(str, widthp) mb_metastrlen(str, widthp) -#ifdef BROKEN_WCWIDTH +#if defined(BROKEN_WCWIDTH) && defined(__STDC_ISO_10646__) #define WCWIDTH(wc) mk_wcwidth(wc) #else #define WCWIDTH(wc) wcwidth(wc)