[2/3] diagnostics: Don't hardcode auto_enable_urls to false for mingw platforms

Message ID 20240509144808.18468-2-peter0x44@disroot.org
State New
Headers
Series [1/3] diagnostics: Enable escape sequence processing on windows consoles |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gcc_check--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 success Testing passed

Commit Message

Peter0x44 May 9, 2024, 2:48 p.m. UTC
  Windows terminal and mintty both have support for link escape sequences, and so
should follow the same detection logic as the rest of the hosts. With
conhost.exe, the embedded URLs are not supported, but it doesn't cause any
problems to print them.

gcc/ChangeLog:
	* diagnostic-color.cc (auto_enable_urls): Don't hardcode to return
	false on mingw hosts.

Signed-off-by: Peter Damianov <peter0x44@disroot.org>
---
 gcc/diagnostic-color.cc | 4 ----
 1 file changed, 4 deletions(-)
  

Patch

diff --git a/gcc/diagnostic-color.cc b/gcc/diagnostic-color.cc
index 0a4845406f5..e9183bb293d 100644
--- a/gcc/diagnostic-color.cc
+++ b/gcc/diagnostic-color.cc
@@ -292,9 +292,6 @@  parse_env_vars_for_urls ()
 static bool
 auto_enable_urls ()
 {
-#ifdef __MINGW32__
-  return false;
-#else
   const char *term, *colorterm;
 
   /* First check the terminal is capable of printing color escapes,
@@ -336,7 +333,6 @@  auto_enable_urls ()
     return false;
 
   return true;
-#endif
 }
 
 /* Determine if URLs should be enabled, based on RULE,