From a7f8b56ec460763c644a948cbb8f3aada0cc7087 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 10 Nov 2009 23:08:17 +0200 Subject: Rearrange variables and Windows-only code to avoid warning --- shell/main.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/shell/main.c b/shell/main.c index 491865532b..cb7cee4f59 100644 --- a/shell/main.c +++ b/shell/main.c @@ -466,9 +466,19 @@ create_default_shell (void) g_idle_add ((GSourceFunc) idle_cb, remaining_args); } +#ifdef G_OS_WIN32 +extern void link_shutdown (void); +#endif + gint main (gint argc, gchar **argv) { + GConfClient *client; +#ifdef DEVELOPMENT + gboolean skip_warning_dialog; +#endif + GError *error = NULL; + #ifdef G_OS_WIN32 if (fileno (stdout) != -1 && _get_osfhandle (fileno (stdout)) != -1) { /* stdout is fine, presumably redirected to a file or pipe */ @@ -479,23 +489,14 @@ main (gint argc, gchar **argv) (AttachConsole_t) GetProcAddress ( GetModuleHandle ("kernel32.dll"), "AttachConsole"); - if (p_AttachConsole != NULL && p_AttachConsole (ATTACH_PARENT_PROCESS)) - { + if (p_AttachConsole != NULL && p_AttachConsole (ATTACH_PARENT_PROCESS)) { freopen ("CONOUT$", "w", stdout); dup2 (fileno (stdout), 1); freopen ("CONOUT$", "w", stderr); dup2 (fileno (stderr), 2); } } - - extern void link_shutdown (void); -#endif - - GConfClient *client; -#ifdef DEVELOPMENT - gboolean skip_warning_dialog; #endif - GError *error = NULL; /* Make ElectricFence work. */ free (malloc (10)); -- cgit v1.2.3