summaryrefslogtreecommitdiff
path: root/glib/glib-init.h
diff options
context:
space:
mode:
authorРуслан Ижбулатов <lrn1986@gmail.com>2017-11-26 18:27:51 +0000
committerРуслан Ижбулатов <lrn1986@gmail.com>2018-06-13 19:20:01 +0000
commitcb0cd2a815cbce274189056451b7468b33c8f631 (patch)
tree7eafd097258efd20b84b3b16bbe2a648587cb531 /glib/glib-init.h
parentc26558c1b1391f32f208a48a47fa7a714f2b7529 (diff)
downloadglib-lrn/attachconsole.tar.gz
W32: add std stream redirection envvar optionslrn/attachconsole
This commit adds two W32-only environmental variable checks: * G_WIN32_ALLOC_CONSOLE, if set to 1, will force glib to create a new console if the process has no console by itself. This option is for GUI apps that are launched from GUI processes, in which case there's no console anywhere near them. * G_WIN32_ATTACH_CONSOLE, if set to a comma-separated list of standard stream names (stdint, stdout, stderr), will reopen a given std stream and tie it to the console (using existing console or parent console). This works either with the other option (to create a console), or if the app is launched from a console process (often the case for developers). The redirection is done with freopen(), dup() and dup2(). If everything goes well, C file descriptors 0, 1 or 2 will be bound to stdin, stdout and stderr respectively (only for streams listed in the envrionmental variable), and so will be stdio streams by the same names. With these it's possible to see the output of g_log*() functions when running GTK4 applications, which are linked as GUI applications, and thus do not get a console by default. https://bugzilla.gnome.org/show_bug.cgi?id=790857 Fixes issue #1304
Diffstat (limited to 'glib/glib-init.h')
-rw-r--r--glib/glib-init.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/glib/glib-init.h b/glib/glib-init.h
index 5da33c052..695dc044b 100644
--- a/glib/glib-init.h
+++ b/glib/glib-init.h
@@ -34,6 +34,7 @@ void g_quark_init (void);
void g_thread_win32_process_detach (void);
void g_thread_win32_thread_detach (void);
void g_thread_win32_init (void);
+void g_console_win32_init (void);
void g_clock_win32_init (void);
extern HMODULE glib_dll;
#endif