From 5bf714b008210c88dfa9cde6b921ebdc0e562664 Mon Sep 17 00:00:00 2001
From: Andrew Borodin <aborodin@vmail.ru>
Date: Thu, 15 Oct 2020 15:16:24 +0300
Subject: [PATCH] Ticket #4131: use G_UNICODE_SPACING_MARK instead of
G_UNICODE_COMBINING_MARK.
G_UNICODE_COMBINING_MARK is deperecated in glib >= 30.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
---
lib/strutil/strutilutf8.c | 2 +-
src/viewer/ascii.c | 10 ++--------
2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/lib/strutil/strutilutf8.c b/lib/strutil/strutilutf8.c
index efec6be54..5ac0015e6 100644
a
|
b
|
str_unichar_iscombiningmark (gunichar uni) |
70 | 70 | GUnicodeType type; |
71 | 71 | |
72 | 72 | type = g_unichar_type (uni); |
73 | | return (type == G_UNICODE_COMBINING_MARK) |
| 73 | return (type == G_UNICODE_SPACING_MARK) |
74 | 74 | || (type == G_UNICODE_ENCLOSING_MARK) || (type == G_UNICODE_NON_SPACING_MARK); |
75 | 75 | } |
76 | 76 | |
diff --git a/src/viewer/ascii.c b/src/viewer/ascii.c
index 67b653434..e2a3ce934 100644
a
|
b
|
|
162 | 162 | |
163 | 163 | /*** file scope macro definitions ****************************************************************/ |
164 | 164 | |
165 | | #if GLIB_CHECK_VERSION (2, 30, 0) |
166 | | #define SPACING_MARK G_UNICODE_SPACING_MARK |
167 | | #else |
168 | | #define SPACING_MARK G_UNICODE_COMBINING_MARK |
169 | | #endif |
170 | | |
171 | 165 | /* The Unicode standard recommends that lonely combining characters are printed over a dotted |
172 | 166 | * circle. If the terminal is not UTF-8, this will be replaced by a dot anyway. */ |
173 | 167 | #define BASE_CHARACTER_FOR_LONELY_COMBINING 0x25CC /* dotted circle */ |
… |
… |
mcview_is_spacing_mark (const WView * view, int c) |
266 | 260 | { |
267 | 261 | #ifdef HAVE_CHARSET |
268 | 262 | if (view->utf8) |
269 | | return g_unichar_type (c) == SPACING_MARK; |
| 263 | return g_unichar_type (c) == G_UNICODE_SPACING_MARK; |
270 | 264 | #else |
271 | 265 | (void) view; |
272 | 266 | (void) c; |
… |
… |
mcview_next_combining_char_sequence (WView * view, mcview_state_machine_t * stat |
535 | 529 | return i; |
536 | 530 | if (!mcview_ismark (view, cs[i]) || !mcview_isprint (view, cs[i])) |
537 | 531 | return i; |
538 | | if (g_unichar_type (cs[i]) == SPACING_MARK) |
| 532 | if (g_unichar_type (cs[i]) == G_UNICODE_SPACING_MARK) |
539 | 533 | { |
540 | 534 | /* Only allow as the first combining char. Stop processing in either case. */ |
541 | 535 | if (i == 1) |