From 4cee04596715eb29cccaf607ec88a1cf632c7869 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Thu, 30 Jan 2020 20:50:08 -0800 Subject: [PATCH] Update to latest widecharwidth Fixes a Cygwin incompatibility. Fixes #6549 Cherry-pick from 73106198c8f36adb26c7dab906119d51023329eb --- src/widecharwidth/widechar_width.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/widecharwidth/widechar_width.h b/src/widecharwidth/widechar_width.h index 3e63ffbd0..402bc4407 100644 --- a/src/widecharwidth/widechar_width.h +++ b/src/widecharwidth/widechar_width.h @@ -1,5 +1,5 @@ /** - * widechar_width.h, generated on 2019-05-14. + * widechar_width.h, generated on 2020-01-30. * See https://github.com/ridiculousfish/widecharwidth/ * * SHA1 file hashes: @@ -30,8 +30,8 @@ enum { /* An inclusive range of characters. */ struct widechar_range { - wchar_t lo; - wchar_t hi; + uint32_t lo; + uint32_t hi; }; /* Simple ASCII characters - used a lot, so we check them first. */ @@ -506,14 +506,14 @@ static const struct widechar_range widechar_widened_table[] = { }; template -bool widechar_in_table(const Collection &arr, wchar_t c) { +bool widechar_in_table(const Collection &arr, uint32_t c) { auto where = std::lower_bound(std::begin(arr), std::end(arr), c, - [](widechar_range p, wchar_t c) { return p.hi < c; }); + [](widechar_range p, uint32_t c) { return p.hi < c; }); return where != std::end(arr) && where->lo <= c; } /* Return the width of character c, or a special negative value. */ -int widechar_wcwidth(wchar_t c) { +int widechar_wcwidth(uint32_t c) { if (widechar_in_table(widechar_ascii_table, c)) return 1; if (widechar_in_table(widechar_private_table, c))