From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk (Zsh hackers list)
Subject: Re: PATCH: alternative wcwidth() implementation
Date: Wed, 23 Apr 2008 11:33:22 +0100 [thread overview]
Message-ID: <20080423113322.18e43f6e@news01> (raw)
In-Reply-To: <20080422171543.5bc9f519@news01>
On Tue, 22 Apr 2008 17:15:43 +0100
Peter Stephenson <pws@csr.com> wrote:
> 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.
On Solaris 8 this isn't good enough: we need the _EXTENDED version or we
don't get the full interface from sys/time.h. That's already in use in
some cases, maybe this isn't too big a deal...
Index: Src/system.h
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/system.h,v
retrieving revision 1.50
diff -u -r1.50 system.h
--- Src/system.h 22 Apr 2008 16:18:55 -0000 1.50
+++ Src/system.h 23 Apr 2008 10:30:05 -0000
@@ -56,8 +56,13 @@
# define _XOPEN_SOURCE_EXTENDED 1
#else
# ifdef MULTIBYTE_SUPPORT
-/* Needed for wcwidth() which is part of XSI */
-# define _XOPEN_SOURCE 1
+/*
+ * 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
--
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-23 10:33 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
2008-04-23 10:33 ` Peter Stephenson [this message]
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=20080423113322.18e43f6e@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).