gst-inspect: Add define guard for g_log_writer_supports_color()

g_log_writer_supports_color() was introduced since GLib 2.50.0
which is slightly higher version than our minimum required GLib version.
This commit is contained in:
Seungha Yang 2020-02-26 22:29:43 +09:00
parent e9085043c1
commit 2af630b0c1

View file

@ -2077,11 +2077,16 @@ main (int argc, char *argv[])
}
#elif defined(G_OS_WIN32)
{
/* g_log_writer_supports_color is available since 2.50.0 */
#if GLIB_CHECK_VERSION(2,50,0)
gint fd = _fileno (stdout);
/* On Windows 10, g_log_writer_supports_color will also setup the console
* so that it correctly interprets ANSI VT sequences if it's supported */
if (!_isatty (fd) || !g_log_writer_supports_color (fd))
colored_output = FALSE;
#else
colored_output = FALSE;
#endif
}
#endif