about summary refs log tree commit diff
path: root/Src/zsh.h
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2012-08-23 19:19:26 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2012-08-23 19:19:26 +0000
commit13b8a25456f038e0dbf7daf187cb0e5b9b9558c9 (patch)
treefb430d471ec8aa5804ba2b751366cff6c9529711 /Src/zsh.h
parent32438824c0f92d64956c35a543ead4687f029ddb (diff)
downloadzsh-13b8a25456f038e0dbf7daf187cb0e5b9b9558c9.tar.gz
zsh-13b8a25456f038e0dbf7daf187cb0e5b9b9558c9.tar.xz
zsh-13b8a25456f038e0dbf7daf187cb0e5b9b9558c9.zip
Jun T.: 30640: MacOS doesn't define __STDC_ISO_10646__ but we need
the replacement wcwidth function anyway
Diffstat (limited to 'Src/zsh.h')
-rw-r--r--Src/zsh.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/Src/zsh.h b/Src/zsh.h
index b9f2846f7..e20838249 100644
--- a/Src/zsh.h
+++ b/Src/zsh.h
@@ -2681,7 +2681,14 @@ typedef wint_t convchar_t;
 #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__)
+/*
+ * We replace broken implementations with one that uses Unicode
+ * characters directly as wide characters.  In principle this is only
+ * likely to work if __STDC_ISO_10646__ is defined, since that's pretty
+ * much what the definition tells us.  However, we happen to know this
+ * works on MacOS which doesn't define that.
+ */
+#if defined(BROKEN_WCWIDTH) && (defined(__STDC_ISO_10646__) || defined(__APPLE__))
 #define WCWIDTH(wc)	mk_wcwidth(wc)
 #else
 #define WCWIDTH(wc)	wcwidth(wc)