* gcc/pretty-print.c (eat_esc_sequence): Swap the foreground and background
colors if the COMMON_LVB_REVERSE_VIDEO flag is set, and clear it thereafter,
as it only works for DBCS.
From-SVN: r263531
+2018-08-13 Liu Hao <lh_mouse@126.com>
+
+ * pretty-print.c (eat_esc_sequence): Swap the foreground and
+ background colors if the COMMON_LVB_REVERSE_VIDEO flag is set,
+ and clear it thereafter, as it only works for DBCS.
+
2018-08-13 Liu Hao <lh_mouse@126.com>
* pretty-print.c (mingw_ansi_fputs): Do not call _close() on the
{
attrib_add |= sb.wAttributes & ~attrib_rm;
}
+ if (attrib_add & COMMON_LVB_REVERSE_VIDEO)
+ {
+ /* COMMON_LVB_REVERSE_VIDEO is only effective for DBCS.
+ * Swap foreground and background colors by hand.
+ */
+ attrib_add = (attrib_add & 0xFF00)
+ | ((attrib_add & 0x00F0) >> 4)
+ | ((attrib_add & 0x000F) << 4);
+ attrib_add &= ~COMMON_LVB_REVERSE_VIDEO;
+ }
SetConsoleTextAttribute (h, attrib_add);
break;
}