From 34a25459d2b04c856cf4cda92c4595a8be0d216a Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Fri, 16 Jan 2015 14:34:27 +0300 Subject: [PATCH] Ticket #3389: mcviewer: clarify usage of G_UNICODE_SPACING_MARK. Signed-off-by: Andrew Borodin --- src/viewer/ascii.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/viewer/ascii.c b/src/viewer/ascii.c index b6848e225..e835a9db7 100644 --- a/src/viewer/ascii.c +++ b/src/viewer/ascii.c @@ -162,6 +162,12 @@ /*** file scope macro definitions ****************************************************************/ +#if GLIB_CHECK_VERSION (2, 30, 0) +#define SPACING_MARK G_UNICODE_SPACING_MARK +#else +#define SPACING_MARK G_UNICODE_COMBINING_MARK +#endif + /* The Unicode standard recommends that lonely combining characters are printed over a dotted * circle. If the terminal is not UTF-8, this will be replaced by a dot anyway. */ #define BASE_CHARACTER_FOR_LONELY_COMBINING 0x25CC /* dotted circle */ @@ -260,7 +266,7 @@ mcview_is_spacing_mark (const mcview_t * view, int c) { #ifdef HAVE_CHARSET if (view->utf8) - return g_unichar_type (c) == G_UNICODE_SPACING_MARK; + return g_unichar_type (c) == SPACING_MARK; #else (void) view; (void) c; @@ -530,7 +536,7 @@ mcview_next_combining_char_sequence (mcview_t * view, mcview_state_machine_t * s return i; if (!mcview_ismark (view, cs[i]) || !mcview_isprint (view, cs[i])) return i; - if (g_unichar_type (cs[i]) == G_UNICODE_SPACING_MARK) + if (g_unichar_type (cs[i]) == SPACING_MARK) { /* Only allow as the first combining char. Stop processing in either case. */ if (i == 1) -- 2.11.4.GIT