From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk (Zsh hackers list)
Subject: Re: PATCH: alternative wcwidth() implementation
Date: Tue, 22 Apr 2008 17:15:43 +0100 [thread overview]
Message-ID: <20080422171543.5bc9f519@news01> (raw)
In-Reply-To: <31339.1208861418@csr.com>
On Tue, 22 Apr 2008 11:50:18 +0100
Peter Stephenson <pws@csr.com> 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 <pws@csr.com> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
next prev parent reply other threads:[~2008-04-22 16:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-22 10:50 Peter Stephenson
2008-04-22 16:15 ` Peter Stephenson [this message]
2008-04-23 10:33 ` Peter Stephenson
2008-04-22 17:56 ` Jun T.
2008-04-23 8:44 ` Peter Stephenson
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=20080422171543.5bc9f519@news01 \
--to=pws@csr.com \
--cc=zsh-workers@sunsite.dk \
/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).