[PATCH v4] Fixes CJK wide character display

Kristian Høgsberg hoegsberg at gmail.com
Mon Aug 19 15:37:42 PDT 2013


On Mon, Aug 19, 2013 at 01:00:52PM -0700, Othman, Ossama wrote:
> Hi,
> 
> CCing the list this time around ...
> 
> On Sun, Aug 18, 2013 at 7:59 PM, Peng Wu <peng.e.wu at gmail.com> wrote:
> 
> > By jumping two columns when wide character prints,
> > and draw wide background under wide character.
> > ---
> >  clients/terminal.c | 31 +++++++++++++++++++++++++++++--
> >  1 file changed, 29 insertions(+), 2 deletions(-)
> >
> > diff --git a/clients/terminal.c b/clients/terminal.c
> > index 6701fb6..9da1a56 100644
> > --- a/clients/terminal.c
> > +++ b/clients/terminal.c
> > @@ -33,6 +33,9 @@
> >  #include <ctype.h>
> >  #include <cairo.h>
> >  #include <sys/epoll.h>
> > +#define __USE_XOPEN
> > +#include <wchar.h>
> > +#include <locale.h>
> >
> 
> That's an implementation-specific preprocessor symbol.  Please use the
> _XOPEN_SOURCE feature test macro instead.
> 
> The user could also potentially define that feature test macro with a
> specific value, such as 500 (see
> http://pubs.opengroup.org/onlinepubs/7908799/xsh/compilation.html), in
> CPPFLAGS via the configure script as well, meaning it would be good to
> check if _XOPEN_SOURCE is defined before explicitly defining it.

I changed the __USE_XOPEN #define to

#define _XOPEN_SOURCE 700 /* for strnlen, snprintf and wcwidth */

where 700 is requried for strnlen it seems.  I'm not sure if we should
be testing for this in configure somehow, but let's go with this for
now.  Patch committed, weston-terminal now has support for wide
characters.  Thanks!

Kristian


More information about the wayland-devel mailing list