diff options
author | Liu Hao <lh_mouse@126.com> | 2018-08-14 10:04:10 +0000 |
---|---|---|
committer | Jonathan Yong <jyong@gcc.gnu.org> | 2018-08-14 10:04:10 +0000 |
commit | 5d3083dde2a4fb03fab20d66fda1a5881801c757 (patch) | |
tree | 507377ce956009509995349b7c611a81f887d1ef /gcc | |
parent | e99c19aae1cf5b9bb0350eb578be85429f42f607 (diff) | |
download | gcc-5d3083dde2a4fb03fab20d66fda1a5881801c757.zip gcc-5d3083dde2a4fb03fab20d66fda1a5881801c757.tar.gz gcc-5d3083dde2a4fb03fab20d66fda1a5881801c757.tar.bz2 |
pretty-print.c (eat_esc_sequence): Swap the foreground and background colors if...
* 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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/pretty-print.c | 10 |
2 files changed, 16 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ec466de..1e108ef 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 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 handle returned by _get_osf_handle(). diff --git a/gcc/pretty-print.c b/gcc/pretty-print.c index 31eb889..02967d0 100644 --- a/gcc/pretty-print.c +++ b/gcc/pretty-print.c @@ -640,6 +640,16 @@ sgr_set_it: { 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; } |