summaryrefslogtreecommitdiff
path: root/pith/charconv/utf8.c
diff options
context:
space:
mode:
Diffstat (limited to 'pith/charconv/utf8.c')
-rw-r--r--pith/charconv/utf8.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/pith/charconv/utf8.c b/pith/charconv/utf8.c
index d2f34e61..29341f71 100644
--- a/pith/charconv/utf8.c
+++ b/pith/charconv/utf8.c
@@ -24,6 +24,8 @@ static char rcsid[] = "$Id: utf8.c 1184 2008-12-16 23:52:15Z hubert@u.washington
#ifdef _WINDOWS
/* wingdi.h uses ERROR (!) and we aren't using the c-client ERROR so... */
#undef ERROR
+#else
+#define _XOPEN_SOURCE
#endif
#include <system.h>
@@ -98,6 +100,15 @@ wcellwidth(UCS ucs)
#endif
}
+int
+pith_ucs4width(UCS ucs)
+{
+#ifndef _WINDOWS
+ return wcwidth((wchar_t) ucs);
+#else
+ return 0;
+#endif /* _WINDOWS */
+}
/*
* Argument is a UCS-4 wide character.