Ticket #3389: mcviewer: clarify usage of G_UNICODE_SPACING_MARK.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2015-01-16 14:34:27 +03:00
parent 1c7c344ca4
commit 34a25459d2

View File

@ -162,6 +162,12 @@
/*** file scope macro definitions ****************************************************************/ /*** 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 /* 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. */ * 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 */ #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 #ifdef HAVE_CHARSET
if (view->utf8) if (view->utf8)
return g_unichar_type (c) == G_UNICODE_SPACING_MARK; return g_unichar_type (c) == SPACING_MARK;
#else #else
(void) view; (void) view;
(void) c; (void) c;
@ -530,7 +536,7 @@ mcview_next_combining_char_sequence (mcview_t * view, mcview_state_machine_t * s
return i; return i;
if (!mcview_ismark (view, cs[i]) || !mcview_isprint (view, cs[i])) if (!mcview_ismark (view, cs[i]) || !mcview_isprint (view, cs[i]))
return 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. */ /* Only allow as the first combining char. Stop processing in either case. */
if (i == 1) if (i == 1)