This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
[PATCH 1/2] fix conflicting types (wint_t)
- From: uchan0+newlib at gmail dot com
- To: newlib at sourceware dot org
- Cc: uchan-nos <uchan0 at gmail dot com>
- Date: Tue, 23 Jul 2019 21:15:47 +0900
- Subject: [PATCH 1/2] fix conflicting types (wint_t)
From: uchan-nos <uchan0@gmail.com>
---
newlib/libc/string/wcwidth.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/newlib/libc/string/wcwidth.c b/newlib/libc/string/wcwidth.c
index 62e76edc3..a4b520bbe 100644
--- a/newlib/libc/string/wcwidth.c
+++ b/newlib/libc/string/wcwidth.c
@@ -225,10 +225,16 @@ __wcwidth (const wint_t ucs)
#endif /* _MB_CAPABLE */
}
+#ifdef __CYGWIN__
+#define WCHAR_TYPE wint_t
+#else
+#define WCHAR_TYPE wchar_t
+#endif
+
int
-wcwidth (const wint_t wc)
+wcwidth (const WCHAR_TYPE wc)
{
- wint_t wi = wc;
+ WCHAR_TYPE wi = wc;
#ifdef _MB_CAPABLE
wi = _jp2uc (wi);
--
2.17.1