From 3d113fef3690395f19fb93e999f467f67710e839 Mon Sep 17 00:00:00 2001 From: Yevgen Muntyan <17531749+muntyan@users.noreply.github.com> Date: Sun, 12 Nov 2017 12:15:34 -0800 Subject: [PATCH] Fixed linux build --- moo/moofileview/moofileview-tools.c | 2 +- moo/moolua/lua/moolua.cpp | 2 +- moo/mooutils/moospawn.c | 2 +- moo/mooutils/moospawn.h | 6 ++++++ moo/plugins/usertools/moocommand-exe.cpp | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/moo/moofileview/moofileview-tools.c b/moo/moofileview/moofileview-tools.c index 108b0cf0..52e371fd 100644 --- a/moo/moofileview/moofileview-tools.c +++ b/moo/moofileview/moofileview-tools.c @@ -90,7 +90,7 @@ run_command (const char *command_template, error = NULL; } - if (command && !moo_spawn_command_line_async_with_flags (command, G_SPAWN_WIN32_HIDDEN_CONSOLE, &error)) + if (command && !moo_spawn_command_line_async_with_flags (command, MOO_SPAWN_WIN32_HIDDEN_CONSOLE, &error)) { g_warning ("%s", moo_error_message (error)); g_error_free (error); diff --git a/moo/moolua/lua/moolua.cpp b/moo/moolua/lua/moolua.cpp index ed0d6e16..e13b705a 100644 --- a/moo/moolua/lua/moolua.cpp +++ b/moo/moolua/lua/moolua.cpp @@ -120,7 +120,7 @@ cfunc__execute (lua_State *L) } if (!g_spawn_sync (NULL, argv, NULL, - (GSpawnFlags) (G_SPAWN_SEARCH_PATH | G_SPAWN_WIN32_HIDDEN_CONSOLE), + (GSpawnFlags) (G_SPAWN_SEARCH_PATH | MOO_SPAWN_WIN32_HIDDEN_CONSOLE), NULL, NULL, NULL, NULL, &exit_status, &error)) { diff --git a/moo/mooutils/moospawn.c b/moo/mooutils/moospawn.c index d85a7cd4..3862732c 100644 --- a/moo/mooutils/moospawn.c +++ b/moo/mooutils/moospawn.c @@ -530,7 +530,7 @@ moo_cmd_run_command (MooCmd *cmd, else #endif { - flags |= G_SPAWN_WIN32_HIDDEN_CONSOLE; + flags |= MOO_SPAWN_WIN32_HIDDEN_CONSOLE; if ((flags & G_SPAWN_STDOUT_TO_DEV_NULL) || (cmd_flags & MOO_CMD_STDOUT_TO_PARENT)) outp = NULL; diff --git a/moo/mooutils/moospawn.h b/moo/mooutils/moospawn.h index 5dfa3521..fb61135f 100644 --- a/moo/mooutils/moospawn.h +++ b/moo/mooutils/moospawn.h @@ -64,6 +64,12 @@ struct _MooCmdClass const char *line); }; +#ifdef __WIN32__ +#define MOO_SPAWN_WIN32_HIDDEN_CONSOLE G_SPAWN_WIN32_HIDDEN_CONSOLE +#else +#define MOO_SPAWN_WIN32_HIDDEN_CONSOLE 0 +#endif + GType _moo_cmd_get_type (void) G_GNUC_CONST; MooCmd *_moo_cmd_new (const char *working_dir, diff --git a/moo/plugins/usertools/moocommand-exe.cpp b/moo/plugins/usertools/moocommand-exe.cpp index cd8df8ba..9062b115 100644 --- a/moo/plugins/usertools/moocommand-exe.cpp +++ b/moo/plugins/usertools/moocommand-exe.cpp @@ -546,7 +546,7 @@ run_sync (const char *base_cmd_line, { GError *error = NULL; gboolean result = FALSE; - GSpawnFlags flags = (GSpawnFlags) (RUN_CMD_FLAGS | G_SPAWN_WIN32_HIDDEN_CONSOLE); + GSpawnFlags flags = (GSpawnFlags) (RUN_CMD_FLAGS | MOO_SPAWN_WIN32_HIDDEN_CONSOLE); char **argv; char **real_env; char *cmd_line;