Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: alternative wcwidth() implementation
- X-seq: zsh-workers 24867
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx (Zsh hackers list)
- Subject: Re: PATCH: alternative wcwidth() implementation
- Date: Wed, 23 Apr 2008 11:33:22 +0100
- In-reply-to: <20080422171543.5bc9f519@news01>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- Organization: CSR
- References: <31339.1208861418@xxxxxxx> <20080422171543.5bc9f519@news01>
On Tue, 22 Apr 2008 17:15:43 +0100
Peter Stephenson <pws@xxxxxxx> wrote:
> On Tue, 22 Apr 2008 11:50:18 +0100
> Peter Stephenson <pws@xxxxxxx> 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@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
Messages sorted by:
Reverse Date,
Date,
Thread,
Author