From: yamt@mwd.biglobe.ne.jp (YAMAMOTO Takashi)
To: zsh-workers@zsh.org
Subject: Re: wcwidth autoconf bug
Date: Tue, 7 Aug 2012 03:12:51 +0000 (UTC) [thread overview]
Message-ID: <20120807031251.ECE9914A601@mail.netbsd.org> (raw)
In-Reply-To: Your message of "Mon, 6 Aug 2012 06:32:40 +0000 (UTC)" <20120806063240.31AFE14A3DF@mail.netbsd.org>
> 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)
next prev parent reply other threads:[~2012-08-07 3:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-25 9:03 YAMAMOTO Takashi
2012-07-28 20:06 ` Peter Stephenson
2012-08-06 6:32 ` YAMAMOTO Takashi
2012-08-07 3:12 ` YAMAMOTO Takashi [this message]
2012-08-07 18:38 ` Peter Stephenson
2012-08-23 14:43 Jun T.
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=20120807031251.ECE9914A601@mail.netbsd.org \
--to=yamt@mwd.biglobe.ne.jp \
--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).