Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: wcwidth autoconf bug



On Mac OS X, wcwidth() is broken but __STDC_ISO_10646__ is NOT defined.

(I guess 'if defined(__APPLE__) && defined(BROKEN_WCWIDTH)' would
be enough, but just in case...)


Index: Src/compat.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/compat.c,v
retrieving revision 1.22
diff -u -r1.22 compat.c
--- Src/compat.c	7 Aug 2012 18:29:03 -0000	1.22
+++ Src/compat.c	23 Aug 2012 13:37:29 -0000
@@ -630,7 +630,7 @@
 #endif /* HAVE_STRTOUL */
 
 /**/
-#if defined(BROKEN_WCWIDTH) && defined(__STDC_ISO_10646__)
+#if defined(BROKEN_WCWIDTH) && (defined(__STDC_ISO_10646__) || defined(__APPLE__))
 
 /*
  * This is an implementation of wcwidth() and wcswidth() (defined in
@@ -949,5 +949,5 @@
 #endif /* 0 */
 
 /**/
-#endif /* BROKEN_WCWIDTH && __STDC_ISO_10646__ */
+#endif /* BROKEN_WCWIDTH && (__STDC_ISO_10646__ || __APPLE__) */
 
Index: Src/zsh.h
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/zsh.h,v
retrieving revision 1.183
diff -u -r1.183 zsh.h
--- Src/zsh.h	21 Aug 2012 18:03:03 -0000	1.183
+++ Src/zsh.h	23 Aug 2012 13:37:30 -0000
@@ -2681,7 +2681,7 @@
 #define MB_METASTRWIDTH(str)	mb_metastrlen(str, 1)
 #define MB_METASTRLEN2(str, widthp)	mb_metastrlen(str, widthp)
 
-#if defined(BROKEN_WCWIDTH) && defined(__STDC_ISO_10646__)
+#if defined(BROKEN_WCWIDTH) && (defined(__STDC_ISO_10646__) || defined(__APPLE__))
 #define WCWIDTH(wc)	mk_wcwidth(wc)
 #else
 #define WCWIDTH(wc)	wcwidth(wc)





Messages sorted by: Reverse Date, Date, Thread, Author